Observing hoisting of let declarations
Can the user observe the hoisting of identifiers declared with let (or const)?I ask because referring to the identifier before the lexical declaration will always result in a ReferenceError as though...
View ArticleHow to upload images to an ExpressJS server
I feel like I'm losing my mind trying to solve this problem. I'm a fairly new web developer (this is like my third real project) and I'm trying to create a one-page application with image upload...
View ArticleJavaScript - Exporting a harcoded array vs creating one
Let's say I have a file data.js, which contains an array of some data that will be imported somewhere (eg. a React component).EXAMPLE A:const DATA = [ { firstName: 'jim', lastName: 'beam', fullName:...
View Articlehow to call a greasemonkey js script function from flask?
I have a simple greasemonkey script that sends data to a flask python script. Nothing too complicated just a step above hello world. This works fine but what I want to do is the reverse process. That...
View ArticleNeed to click twice to add/remove a Class with Javascript
I read some of the answers here similar to my question, but I still don't understand what's going on.I have this JS snippet:function renderButtons() { let buttonCollection =...
View ArticleBet calculator not working when using negative money line
Good day all,I am trying to create a simple small bet calculator with the following line of codes:function betCalculator(moneyLine) { var odds; var betAmount = 500; if (moneyLine > 0) { odds =...
View ArticleDynamically adding/removing Flask fields and autocomplete with javascript
I am trying to achieve the following simultaneously in Flask:Ability to dynamically add and remove a row(simply a StringField in this case) in a wtform tableAbility to autocomplete in that StringFieldI...
View ArticleSeparation of the innerHTML elements in a code format using Regex
The result of my innerHTML is like below in javascript."<ol><li>Testing1</li><li>Testing2</li></ol>"Can I align it in a code format as below using regex or anyother?...
View ArticleJavascript: ReferenceError: i is not defined
Javascript Newbie Here. (sorry in advance).I am making a javascript quiz. I have propagated my array of question, choices[i], and an answer.In order to see if it is a correct answer I am trying to...
View ArticleHow to use express.Router instance for error handling
According to the documentation, any nodejs express middleware function can be replaced by App or Router instances:Since router and app implement the middleware interface, you can use them as you would...
View Articlebabeljs.io version of arrow function fails in safari
The fourth line of the following code (produces the error SyntaxError: Unexpected keyword 'function'. Expected ')' to end a argument list. is produced from babeljs.io. Can you fix the error? Here is a...
View ArticleHow can I have two objects access the same array [duplicate]
Class A is instantiated to an object that has an array named this.people that is filled with a bunch of data. Class A instantiates an object of class B and this.people is passed to it's constructor. If...
View ArticleMongoDB aggregate pipeline to get number of employees for each distinct state
I am trying to show the total number of employees for each state, only for companies in the USA. So it would look like this but for all the states included in the dataset: (Sample numbers)AZ : 1234 CA...
View ArticleJavascript getJSON call being ignored
I have a file setup basically as follows:<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> function...
View ArticleImage file upload with postman working, but my code is not working. is there...
I'm trying to post an image file with form data in angular. which is working fine in postmanIn Postman under headers section I have set..Content-Type : multipart/form-data, token : (user token)and, in...
View ArticleMake a javascript method execute every n milliseconds
I have read this post about executing a function every n seconds, but I am working with classes and want to execute the method every n seconds. I have 2 objects, and each one will have a method that...
View ArticleJoin Tables in TypeORM & NodeJS
I created to TypeORM Entities Category and SubcategoryCategory.ts@Entity() export class Category { @PrimaryGeneratedColumn() id: number; @Column() name: string; @Column() description: string;...
View ArticleDecompress fraction of zip file
To minimise memory usage by the user, we are looking at using HTTP Range Requests to retrieve only parts of a zip archive file that the user is trying to preview. i.e. only the file inside the archive...
View ArticleRequired function on next button
I've problem whit my form, I have all field "required" but when i click on next on form, only the required on first line are taken, the form continues even if the other fields are not complete, i have...
View Articlegetting error in EDGE and IE11 Object doesn't support property or method...
Getting Object doesn't support property or method 'waitUntil'" error while calling in service-worker.js file(in Edge and IE11)self.addEventListener('activate', function(event) {...
View Article