Category "javascript"

React-scripts test: no traceback on exception

I remake browser version of TacticToy game with React, and during unit-tests writing I've got a problem: there is no full traceback of a custom exception, only

Is there a way to animate when div is visible on viewport using animate.style

I want to animate div only when div is visible on viewport using https://animate.style/ At this point it animates div even when its not in viewport which is nor

How to extend components of this type - PaperTextInput.Icon or Tab.Navigator when using styled components?

I noticed that my attempts to extend components like PaperTextInput.Icon or Tab.Navigator are failing and I'm wondering how am I supposed to extend them? What I

How can I solve the asynchronous problem in my code?

Even though the updating is happening successfully in the DB (collection()....) - the batchIdsAdded data that's supposed to be pushed into packIdsOwned and pac

Radio button validation not disappear when select a button using Formik and Yup

I am working to handle a signup form with next js, I used Formik from form and Yup for validation, all things are working correctly except radio buttons. The er

mat-checkbox doesn't render properly inside npx-graph in safari

Have an issue with mat-checkbox in safari and npx-grpah. as you can see below on the screens. this is chrome and on charts mat-checkbox appears properly in eve

Referencing one array to make changes in another given certain conditions in JavaScript [closed]

I have an array, called arr1, example [9, 0, 0 ,9, 9]. I made a copy of this and called it arr2. I am trying to add the value one (1) to certa

ws.write = (result.join(',') + '\n'); && TypeError: result.join is not a function ...how i solve this type error

help to solve in this javascript problem. Give me clear documentation about (join). function main() { const ws = fs.createWriteStream(process.env.OUTPUT_PATH);

How do i center this columns with the content floating to the left?

I would like the two col's to be centered if I have a window larger than 1024pix width and be responsive. I've tried a few things, but unfortunately I'm no long

Javascript adding a new event listener on local object

I have a script below, where I dynamically create an Element Node of type 'li'. This addMovieHandler() is called whenever the user clicks on a button. Additiona

Javascript: Function returning last element of array

I'm taking Colt Steele's Udemy Course titled: "The Web Developer Bootcamp 2020". I have however become stuck on a certain coding exercise. The exercise objectiv

pdf-lib.js - after merging multiple pdf files, filled data in form fields become invisible

pdf-lib.js - after merging multiple pdf files, filled data in form fields become invisible On individually viewing the files, everything is fine and the data ju

Hiding URL in fetch request on client-side in Next.js

I have a simple contact form in Next.js that sends an email by using the FormSubmit api when the submit button is clicked: The code for the onSubmit handler is

Hiding URL in fetch request on client-side in Next.js

I have a simple contact form in Next.js that sends an email by using the FormSubmit api when the submit button is clicked: The code for the onSubmit handler is

Count to numbers above a billion in a few seconds without browser freezing

I am trying to make a counter that counts to big numbers such as 6 billion (like google's random number generator) but the browser freezes. var counter = docume

How to get querySelectorAll from another webpage?

I'm trying to get data from another webpage, using the HTML DOM. I tried code from another StackOverflow question (querySelectorAll() to html from another page)

Regex issue with JavaScript

Just like the title I have an issue with the following code function checkPhone(phone){ var reg = "/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{

Testing Reactive Forms in Angular with Karma

I am testing a function that has a reference to a form in it (this.form), so when I try to test it I am wondering how I can mock that form so the function has a

How to create registered html5 custom element with javascript with IS property and have it run connectedCallback() successfully

Let's say we have an html5 custom element that extends the HTMLAnchorElement and goes by the name 'custom-a', then we insert it directly in the html like this &

Next JS: getServerSideProps cant get cookie [duplicate]

I want to return two cookies, but only one is returned only token cookie, while key cookie cannot be used export async function getServerSideP