I keep hearing that arrow functions inherit the value of this from their Lexical Environment. Consider this example: Why is the value of this inside the arrow callback functions undefined (or in non-strict mode: window)? If the callback function is using the value of this from its lexical environment, shouldn…
Category: Questions
How to get file ID to send mails from GoogleSheets/Script
I’m new to coding and i’m having issues with a code where i keep getting “Error Syntaxis: Missing ) after argument This is my current code: This is my second script, the first one i built it to create PDF for each new google form entry and in column 19 the PDF link is written. The idea is th…
Interval id counter keeps growing after clearing old one
Suppose I have the following intervals, the id of the first interval is 1, even that I cleared it the second interval gets id of 2. is there a way the I can reset the interval’s id when it cleared? such that the second interval will have id of 1. Answer …is there a way the I can reset the
Convert a simple array to a two dimensional array of objects
I want to convert this: …into this: I’ve tried creating a new array and pushing values to it, but that just ends up looking the same. Honestly, I’m unsure of what to even call what I’m trying to create. Is it a two-dimensional array or an array of objects? This is for a google app scri…
Cleaner way instead of running the function every second
I made a simple Coin System with JavaScript. And to make Upgrades, I made a button that gets enabled when it’s over 10. To make this permanently I run this function every millisecond with this: Anyway, is there a cleaner way to run this system without running the function every millisecond? It looks lik…
How to generate a zip file synchronously using JSZip?
I’m working on a React.js application, i have a loop from j=1 to j=2000 and i want to download a zip file when j=1 or j=2000. The problem is that the two zip files downloaded at the same time after the end of the loop. in other words the download of the two zip starts when j = 2000. I
Mapbox color map except for polygons [closed]
Hello i was wondering if anybody knew if there was a way to add some kinda color to the whole map (I’m using mapbox) expect for the places where there are polygons. So that it works like a …
Suitescript adds .0 to numbers in array
In Suitescript 2.0 I want to check if an ID does not match with one of the IDs in the array below: In the debugger I see that .0 is added to every value in the array : Now if my ID is 1 and I do the following check: then this will always be true, because the numbers have
is there any other than querySelector and querySelectorAll that i can use
How can i run all these paragraph? i know querySelector returns the first element but i want to know how can i return both paragraph. I already tried using querySelectorAll but i do not know how to write it. Sorry iam still learning btw Answer I guess this is what are you looking for:
How can I call the function of a parent component inside of a child component?
First off, I’m newer to react so please feel free to critique any sort of architectural problems I have, I feel like there’s a better way to write this but I’ve been struggling for an hour trying to get it to work. Parent Element (TileGrid): Child Element (Tile): So there’s a function …