I am trying to sort an multidimensional array by dates in two columns. Each element of the array looks like that [Thu Feb 25 10:00:00 GMT-05:00 2021, Tue Mar 09 10:00:00 GMT-05:00 2021, 1326M98301, 1326M98301, product 3, 1.0, 2.188120526039E12] I want to sort it first by the second column and then by the firs…
Download public images from google drive in Node.JS
I have a collection of Images on googledrive, and I have a list of links to each of them. They may or may not be public (anyone with the link). I would like to save them locally and embed them in a webpage seperately, as embedding them directly in img tags leads to a delay in image load. I need
“use strict” does not work on ES6 using Visual Studio Code
In “use strict” mode, this in function should be [object Window] rather than the object that calls the function in regular mode. But when I’m trying to proof of concept, it doesn’t work, I’m wondering something’s wrong with the ES6 extension in Visual Studio Code but I don&…
Multiple HtmlWebpackPlugins with webpack DevServer
You can use multiple HtmlWebpackPlugin plugins to create more than one HTML file in production, but only one of the HTML files will be used by the DevServer. Is there any way to use all the HtmlWebpackPlugin plugins in development as well? Answer historyApiFallback can be given manual rewrites to control in a…
turf’s mask() function does not run with 10 or more polygons
I can not run the turf.mask() function with more than 9 randomly created points. It just does not return any result. This works as expected. There are nine holes (created through the randomPoints() function) in the polygon. However, as soon as I change howManyCircles to a number greater than 9, I do not get a…
Using firebase authentication and firestore to add user
Im trying to use user to the authentication of firebase and also firestore. Whhen I click on Save, the function SavePress is activated. The first time I click on this button, the user is added to firebase authentication but user is equal to null. Only at the second time it’s work. If anyone can help me.…
Replace all the coincidences in an inline function
I have a string that is a numbrer str=’20.000.000′ I want another string that adds 1 to that number str=’20.000.001′ i do But it replace only the first ‘.’. How to resolve it? Thanks a lot! Answer use innerHTML.replaceAll(‘.’,”)
How to get the id & title of a DIV element, using pure JavaScript
I have an element: I am trying to get both the id and the title, formatted as such: I’m also trying to use pure Javascript. This is what I have been playing with so far: Does anyone know how to proceed? Answer Mistakes that you have made <= should be changed to < Didn’t close the tag properl…
Is there a “repeat [function] until [property = true]” type of loop in MakeCode JS?
I’m making a game in Microsoft MakeCode Arcade for a school project, and I wanted to know if there was a “repeat [function] until [property = true]” type of loop like there is in Luau. I wanted to use this so that the game waits until my player sprite is at a certain coordinate to run some c…
How to use strict mode and not get an error in JSlint
Looking at all the information out there on JSlint (eg. here or here), the discussion goes something like this Always use strict mode since it catches many more errors. All you have to do is put ‘use strict’ at the top of your code. That’s it! Couldn’t be easier… Except when JSli…