Category "javascript"

Task Runner in Javascript

I have a list of tasks and all these tasks need to be executed only after all the dependencies are resolved for each task. I am struggling to figure out a way t

Async/Await in useEffect(): how to get useState() value?

I have the following code snippet. Why is my limit always 0 in my fetchData? If I were to console.log(limit) outside of this function it has the correct number.

How do I randomly change an HTML element on a timer using Javascript - across the web, not just within the browser?

I'm creating a website with HTML, CSS, and JavaScript. I have a picture element on my page, among other elements. What I want to achieve is to randomnly change

Bootstrap4 table - set constant height for rows

I am trying to create a Bootstrap v4 table which has both a fixed column width and a fixed row height. Any data within the cells which is too long should be tru

Method expression is not of Function type (mongoose Model)

i came across this error today and did not find a fix for it. const mongoose = require('mongoose'); const userSchema = mongoose.Schema({ name: {type:St

GitHub copilot autocomplete one line only shortcut key

Is there a shortcut key to complete the first line only? here I wanted to autocomplete only the line line-height: 1.2;, but if I press the tab it will insert t

How to create a type for file type `Record<string, File>` in zod

I use input type="file" and instead of saving data in FileData I use just plain object and created a type for it: Record<string, File>. It works well, but

Cypress doesn't take updated values in the repetition, only takes hard coded numbers

Why does it seems like cypress wants to know how many times the test cases will repeat before running all the test-cases. In my case I have two test files somet

Are unreferenced default parameters automatically tree-shaken out by webpack?

Obligatory apologies if this has been asked before, but I've been unable to find an answer online or in the webpack docs related to tree shaking. How does tre

Why am i getting " Expected an assignment or function call and instead saw an expression" error here?

Im getting " Expected an assignment or function call and instead saw an expression" error at the seconduse effect, it finds the socket port correctly, am i perf

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

I have a little bug in my console. Every time I try to run my app it breaks. FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory 1

curl: (6) Could not resolve host: summary

I have something wrong in my curl command and after a couple of tries I can't figure it out. The full error log: curl: (6) Could not resolve host: summary curl:

my command handler only recognize the top folder

i have a problem, my Command Handler only recognize the top Folder inside my Commands Directory. Its supposed to show all of the available Folder in Commands Di

In Vuejs3 how to make the sticky header component change background colour when intersecting with other components?

I am just wondering, how to structure my code to make my sticky <Header /> component change its background-color when intersecting with other components (

curl: (6) Could not resolve host: summary

I have something wrong in my curl command and after a couple of tries I can't figure it out. The full error log: curl: (6) Could not resolve host: summary curl:

Need help help knowing where to import Swiperjs

Like the title says, I'm in need of help knowing to import swiperjs. I'm fairly new to Javascript so I'm still learning the ropes. I've already installed it via

WP contact form 7: get current date value to populate an input field

Using contact form 7 on my website, would like to retrieve the form submission date as an input value to use in "Jetpack CRM" for a custom field. I want to avoi

How to solve leetcode problem in JavaScript to check if an integer is a palindrome

Here is the code which i tried to solve, for the leetcode problem in javaScript https://leetcode.com/problems/palindrome-number/ Problem i am facing: It is work

Javascript filter object by condition on only one of its keys

I have an object with the following structure: data = { columns: array of objects, rows: [ { id: 1, process: "A", status: "ok" },

Setting CSS pseudo-class rules from JavaScript

I'm looking for a way to change the CSS rules for pseudo-class selectors (such as :link, :hover, etc.) from JavaScript. So an analogue of the CSS code: a:hover