javascript Questions

4

I've tried to do user verification script for telegram web app for bots. I have no idea how to fix it. import sha256 from 'js-sha256' const telegram = window.Telegram.WebApp const bot_token = '&lt...
Aggri asked 26/4, 2022 at 8:32

7

Solved

I am aware of Boolean(), String() and Number() casting, and the '' + ..., !!... and +... casting approaches. I am wondering if there is any reason to not use the function constructors?
Cinquefoil asked 14/3, 2011 at 18:26

4

I want to use a node library which relies on stream (require('stream')) within a React Native project. This is failing with error stream could not be found within the project because stream is a no...
Roselani asked 1/3, 2021 at 22:4

3

Solved

Consider this simple example, probably a function you wrote a couple of times, but now abortable: /** * * @param {number} delay * @param {AbortSignal} [abortSignal] * @returns {Promise<voi...
Bigeye asked 15/7 at 0:40

2

Solved

I want to get location information by using Geolocation API in react. I made a button to get location info in this code. import React, { Component } from 'react' class App extends Component { c...
Semitone asked 21/4, 2019 at 7:21

4

Solved

I would like to translate the fields of a composite JSON object using Google Cloud Platform, instead of translating every single sentence on its own. Is it possible? Example (from English to Itali...
Muco asked 16/7, 2018 at 13:40

4

I am trying to build a setup menu for my bot that the server owner can use to configure the bot. The menu is triggered when the owner types =setup. I want the bot to reply with several embed messag...
Evenings asked 17/10, 2019 at 20:44

3

Solved

Some odd behaviour on a TextInput on a Modal in React Native Paper. When I type a character, it is input into the text box, but then the cursor flashes back (as if it is deleted) and then it reappe...

4

In VsCode, is there any way to navigate to function definition, to someFunction in this case, line 10, with ctrl + click. Have already checked navigation docs for VS Code https://code.visualst...
Rankins asked 17/4, 2019 at 17:50

2

Solved

In this Three.js shader example a function called rand() (taking a vec2 as an argument) is used to generate random numbers. However, the function is not defined in the shader code. Instead, it see...
Dextrality asked 25/1, 2018 at 9:15

4

Solved

I am trying to write a function in JavaScript to get the unique values ​​of an array, but my code does not work correctly. I know there are other better and simpler ways to do it, but I don't under...
Purim asked 13/10, 2019 at 2:11

2

Solved

I've added NextUI to my NextJS 14 app The issue has been isolated to the ThemeProvider in my main providers.tsx file: 'use client'; import { NextUIProvider } from '@nextui-org/react'; import { The...
Natividadnativism asked 28/3 at 14:50

5

Solved

I'm currently using the Google Maps API for the first time. Essentially I wish to have the map zoomed out so that the whole world is displayed with no overlap (e.g. bits of a certain country are no...
Lemcke asked 10/12, 2013 at 15:19

3

Solved

I have the below component as the main layout. When I click on the menu item, I want them to navigate to the home, holiday calendar, and event pages. What can I do with this horizontal menu? The be...
Munoz asked 6/11, 2022 at 18:34

3

Here is my chart creation createChart = function (name, contributions, idArray) { globalIdArray = idArray; var ctx = document.getElementById("myChart"); var myChart = new Chart(ctx, { type: "b...
Marketplace asked 3/2, 2017 at 15:52

3

Solved

I have a component that has dynamic class names based on the state of the component. The initial state of the menu component is false so an exit animation triggers when I load the site. I'm trying ...
Detoxicate asked 29/8, 2020 at 17:18

2

Solved

I have a firebase storage path that looks like this. firebase.storage().ref('temp/test') the "test" folder has about 25-50 files. I know there is not a way to delete the whole directory i...

5

Solved

I would like to create a select dropdown that contains all values from a column with each value only appearing once. Is there a way to achieve this in JavaScript or jQuery assuming I have a basic...
Azine asked 21/11, 2013 at 21:27

3

I just upgraded to AWS SDK V3 and I have no idea how to configure retryDelayOptions and customBackoff with it. I couldn't find any example code in AWS's own API reference or online. This is what I ...

5

Solved

Is there a way to match repeated characters that are not in a sequence? Let's say I'm looking for at least two 6s in the string. var string = "61236"; I can only find quantifiers that ma...
River asked 16/1, 2014 at 16:17

6

The Problem There are some problem with maybe my installation of better-sqlite3 because when I try to execute my index.js (click to show it on pastebin) with node index.js there is always the s...
Irregular asked 23/6, 2018 at 4:26

3

I am using Discord.js library to create a discord bot. Whenever I am sending an embedded message to a text channel, its width keeps changing with different data. const celestialObject = new Message...
Ingeringersoll asked 12/11, 2020 at 7:4

3

Solved

Using Aleph with Deno found a bug, with the incompatible versions and I need to downgrade. How I can downgrade the deno version from 1.8.1 to 1.6.3 without uninstalling it?
Sind asked 18/3, 2021 at 8:45

2

Solved

Safari has support for ES6 Maps and Sets in version 7.1 and higher (MDN). I'm using a Map in my application and at some point want access to the values. Calling the values() function on the map see...
Verbid asked 16/4, 2015 at 8:54

3

Solved

I try the following code to download multiple files at once: var urls = [...]; for(var i = 0; i < urls.length; i++) { var tempLink = document.createElement('a'); tempLink.setAttribute('href...
Lxx asked 21/5, 2019 at 19:4

© 2022 - 2024 — McMap. All rights reserved.