Skip to content

Tag: javascript

ES6 modules in Chrome

I’m trying to use ES6 modules in Chrome. From all the examples I’ve looked at the following seems to be the right way to do it, but when I run it in Chrome’s developer tools I get this error message… uncaught SyntaxError: Unexpected token { …highlighting the import statement in t…

Getting next element in a table javascript

https://jsfiddle.net/en6jh7pa/1/ I am having issues grabbing the next element, it is returning null for the next element. I am passing “this? as onclick and I assumed that you could use this to grab the next element but it seems that it instead returns null Thanks for your help Answer If you want to get…

ES6: fire React function

This is the code: What I am trying to do is to fire the updateNews code from render: But keep getting this error: Uncaught Error: this.updateNews is not a function Answer You were not calling the functuion Note: You do need to bind because you use arrow function.

What is this piece of Javascript for Isotope filter doing?

I am having some trouble understanding what is happening in a piece of vanilla JS for the Isotope filter. The original code is here: https://codepen.io/desandro/pen/VWLJEb What is happening between the getOnButtonGroupClick function and it being assigned to a variable in the for loop preceding it? Answer getB…