Skip to content

Tag: javascript

Index Values SumUp to Total

I am trying to improve in my Problem Solving Skills and would love to get some explanation on what it is that I am doing wrong or if I can get a hand in the right direction. My code below is what I am stuck on. My problem, I am trying to check within the array if it contains any

Create a row in an airtable base from static html form

I have a static landing page, and would like to create a simple waitlist in airtable using only plain html/javascript. I created a simple form on my landing page, that only accepts an e-mail. After pressing “submit” button, I would like to post this e-mail to my airtable base. I guess it can be do…

Multiple select get Selected options in order selected

i have a multiple select like the following that i have implemented chosen plugin on i have an onchange listener that adds selected elements to an array like so however in which ever option i select the items they always end up arranging themselves in the order they are in the multiple select for example by s…

Move specific properties from object to object

I have an object with a lot of properties, lets say: I want to separate a group of properties as follow: What i am doing is: is this the only way to achive this? is there a way to ignore properties that are undefined? For example let say h is undefined, so ideally obj2 would only be obj2={a,w} It is

WeakMap with event.target

Edit: turns out nothing is actually wrong with the second snippet (my real code). On one page it works, and on another it doesn’t. Yea for underlying errors. I’m creating a DOM element and giving that DOM element to a WeakMap as a key. Then, with JQuery event delegation/event listener, I’m t…

Reduce throws “NaN” in JavaScript?

I am trying to sum items in array. While searching Google and Stack Overflow I found that reduce is a good way of summing an array items. But, when there isn’t any key value pair reduce throws error as “Nah”, so how to deal with it? My array exam: So from above, I need to calculate all the k…