javascript Questions

15

Solved

I'm learning Node.js and just started working with MongoDB. I'm making a connection with the MongoDB Cluster I've created const dbURI = 'mongodb+srv://testuser:[email protected]/mydb?retryWrit...
Assassinate asked 8/1, 2021 at 4:19

2

First of all here is my code in react import { useFormState, useFormStatus } from 'react-dom' import { submitAction } from './action.ts' export default function Calculator() { const [result, subm...
Mantelletta asked 14/1 at 18:0

4

Solved

I tried searching on stack overflow and google but found no article that could help me. It shows a paused video even though i have used autoplay. Can anyone please help me ? I'm new to react.js im...
Runnerup asked 20/10, 2017 at 8:34

2

Solved

I'm trying to unit test a function that returns a promise. I'm having challenges verifying if the mocked functions are called. Here's what I've done., // codetotest.js const { SomeModule, isSomethi...
Flam asked 14/5, 2021 at 17:15

2

I am absolutely desperate with this problem. I fully understand the concept of mobile-first and have been able to make the layout of my website responsive, however, the font-size does not change wh...
Vaginate asked 31/12, 2021 at 10:46

3

Solved

Consider the following HTML document: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style type="text/css"> body...
Appendicectomy asked 28/10, 2017 at 12:30

7

Solved

I need to order an array of objects, composed by a name and a dependencies list (made out of names). An example of this array could be: [ { name: 'a', requires: ['b', 'c'] }, { name: 'b', requi...
Swashbuckling asked 17/4, 2018 at 10:5

6

I am using Firebase to run the backend for my application. When I try to run the backend using firebase emulators:start --inspect-functions it says Node v: 18.13.0 Firebase-tools v: ^11.18.0 Fireba...
Imprimatur asked 15/4, 2023 at 9:52

4

I want to use Chat GPT Turbo api directly in react native (expo) with word by word stream here is working example without stream fetch(`https://api.openai.com/v1/chat/completions`, { body: JSON.s...
Sherrer asked 23/3, 2023 at 17:37

4

Often I am in situations where I need to show a menu on hover and for mobile devices menu should open on click. Now e.g. consider following example: .btn { width: 200px; background-color:...
Rejuvenate asked 23/12, 2016 at 14:5

2

Solved

I am trying to setup a vite project that has multiple entry points. https://stackblitz.com/edit/vitejs-vite-swtkdv It is a pretty basic setup taken straight from the vite website that uses vanilla ...
Mantilla asked 16/11, 2023 at 22:28

3

I used @react-native-community/slider for my app, but I'm facing a problem that it's height is not changing, it's width is changing but not height, anyone know why? and also I want to render value ...
Overplay asked 23/11, 2020 at 12:16

4

I'm trying to delete a cookie using the next/headers module in a Next.js application, but it doesn't seem to work as expected. Here's the code snippet: import {cookies} from "next/headers&quot...
Blond asked 19/6, 2023 at 18:25

9

Solved

I have an API class that I am trying to use in a React app. // API file class API { ... } export default API; // Other file import API from "utils/API"; const api = new API(); And I ...
Excommunicative asked 15/4, 2022 at 22:53

1

I am working on setting up test runner tasks for our project and ran into something unexpected. Our task wasn't getting any of the files using the below pattern: '/tests/**/*.spec.js' Our direct...
Frayda asked 25/4, 2016 at 15:52

3

I have a simple component that handle paste event into a form input. The form: this.searchForm = this.formBuilder.group({ query: [ null, [Validators.required] ] }); onPaste(event) { event.prev...
Eldoria asked 8/12, 2017 at 13:46

2

I have an array of object, one of the property has a null value, I used filter to remove it, but typescript give me warning null is not assignable? since filter will never return null why typescrip...
Mullinax asked 29/12, 2020 at 3:53

4

I am writing a chrome extension that needs to run every time certain webpages are loaded. Currently when I first load a page the script runs. However if I then go to another page and click "Back" ...
Avigdor asked 14/3, 2014 at 1:10

6

Solved

I want to generate next working day using JavaScript. This is my code as of now var today = new Date(); today.setDate(today.getDate()); var tdd = today.getDate(); var tmm = today.getMonth()+1...
Einstein asked 25/8, 2016 at 6:13

3

Solved

I am receiving an Error: xhr poll error in the connect_error event when trying to connect to my websocket gateway. I am using "socket.io-client": "^4.2.0". import { io } from &q...
Justiciary asked 5/10, 2021 at 12:29

2

Solved

I've seen a pattern of using props in of CompositionAPI very often, that is use toRefs to make all entries of props ref. I'm kind of confused by it. For exmaple, from the Vue 3 official guide: expo...
Amr asked 1/10, 2021 at 16:23

8

Solved

I have multiple lines of text in log files in this kind of format: topic, this is the message part, with, occasional commas. How can I split the string from the first comma so I would have the t...
Plumbo asked 25/5, 2011 at 21:30

3

Solved

here is my problem : I try to use the Credential Management API to access to authenticators on my webapp : navigator.credentials.create() and navigator.credentials.get(). I have no problem when I...
Current asked 3/5, 2019 at 14:13

3

Solved

I want to assign a svg-mask to a svg-image. I can make this work using an id on the mask like this: <svg id="svg1" width="5cm" height="5cm" viewBox="0 0 200 200" xmlns="http://www.w3.org/...
Comp asked 3/12, 2017 at 22:53

3

Solved

I just tried out Nashorn and it seems not to support Array.prototype.fill. Is this surprising? Is there a timeline somewhere for Nashorn's intended support? Is the best way to get an array of say 5...
Highpowered asked 30/12, 2017 at 22:29

© 2022 - 2024 — McMap. All rights reserved.