Questions tagged [javascript]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [vue.js], [typescript], [svelte] etc.

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

React Pass Component as props and render it

I am trying to render a React Component passed as props. export type SummaryCardProps = { site?: string; title: string; description?: string; image?: URL; imageAlt?: string; ...
0
votes
0answers
4 views

Mongoose save() doesn't work on seperate function

If i write it like this it is working no problem. leaderboardRouter.post("/simulate-day", async (req, res) => { let users = await User.find({}) let totalEarnedMoney = 0 users.map(...
0
votes
0answers
4 views

Why are these two imcompatible tests passing with Jest?

I am trying to test a BlogPost unit written in JavasCript with Jest. But I notice that these two tests are both passing. import BlogPost from './BlogPost'; test('no blog post fot empty user', () =>...
0
votes
0answers
3 views

React three fiber zoom to object & lookAt

I am trying to transition camera.position and camera.lookAt smoothly between "zoomed out" and "zoomed in" views of individual, randomly placed objects. The positioning works great. ...
0
votes
0answers
6 views

JQuery Datatables Plugin destroy/retrieve methods not behaving as documented

So I'm trying to use datatables with Laravel Livewire. I know that Livewire will only run javascript once on initialization. Therefore, when I go to re-render my component after making a call to the ...
0
votes
0answers
11 views

Measure image time in a Boostrap carousel

This might be a remarkable stupid question. I use setInterval to measure the total time that a user looks at a specific image in a bootstrap carousel, the total interval time and the current index of ...
0
votes
0answers
7 views

Jest Change Mock Object's Function's Value

I want to have a different response from the function of an object with jest mocks. In first test case I will assert cache hit and second case I want to see cache miss. Cache Data Access module....
0
votes
0answers
15 views

How to get a state value from one file and pass it to another in React

I am trying to change parts of a UI depending on a state from another file. I have this component import React from 'react'; import axios from 'axios'; import Button from '../components/button'; ...
0
votes
0answers
6 views

WebAuthn: Can't create public key. Promise is rehected

I am trying to get WebAuthn set up on our login page. I am to the part where I need to make the public key using navigator.credentials.create(). On Chrome, I keep getting the following error: Uncaught ...
0
votes
0answers
10 views

Javascript quiz where a question is appearing inappropriately

I split a 6-question form to show one question at a time, ie it turned into a quiz. The problem is the quiz is working perfectly with 5 questions, but not 6. I don't know why question 6 is appearing ...
-1
votes
2answers
13 views

Error: Cannot read property 'map' of undefined (state) inside render method

In my project I have a table from react material ui. I am getting an error while filling this table when I use data from state to fill the table. The error is cannot read property 'map' of undefined. ...
0
votes
0answers
20 views

How can I change so it zooms in on the correct image in javaScript

Im having some trouble when zooming on mutliple images. When I hover over it I can only zoom in on the original one. So even though I change the image to zoom on, it still keeps the original one. How ...
0
votes
0answers
22 views

How to filter a javascript object array by grouping the objects based on a specific field value?

Below is my js object array. const objArray = [ { file: 'file_1', start_time: '2021-08-12 14:00:00' status: 'pending' }, { file: 'file_2', start_time: '2021-...
0
votes
0answers
9 views

Fixing vue data map to group by date as well as employee

I currently have a vue component and template in which I'm listing employees and their hours/scans by date. The problem is my current map is totaling all hours and scans by the first record and it's ...
-1
votes
1answer
22 views

Unable to submit form with a jquery button

I have a html that sends data to my Google spread sheet when clicking the submit button. My functioning form const scriptURL = 'https://script.google.com/macros/s/...

15 30 50 per page
1
2 3 4 5
150440