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.
I am trying to render a React Component passed as props.
export type SummaryCardProps = {
site?: string;
title: string;
description?: string;
image?: URL;
imageAlt?: string;
...
asked 1 min ago
Ariel
1,59411 gold badge1818 silver badges2828 bronze badges
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(...
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', () =>...
asked 3 mins ago
Ed de Almeida
3,33144 gold badges2020 silver badges4949 bronze badges
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. ...
asked 8 mins ago
laffan
4911 silver badge66 bronze badges
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 ...
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 ...
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....
asked 13 mins ago
Berkin Akaydın
1,25533 gold badges1717 silver badges3535 bronze badges
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';
...
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 ...
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 ...
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. ...
asked 17 mins ago
IonicMan
42322 silver badges1212 bronze badges
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 ...
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-...
asked 26 mins ago
ahkam
23922 silver badges99 bronze badges
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 ...
asked 27 mins ago
Geoff_S
4,08533 gold badges2020 silver badges7171 bronze badges
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/...
asked 29 mins ago
Raven Cheuk
2,37122 gold badges1717 silver badges4545 bronze badges