Message from JavaScript discussions

May 2019

— Pls can one help me solve this clockwise and anticlockwise effect


const rotateCW = ([a,b,c,d,e,f,g,h,i])=>[d,a,b,g,e,c,h,i,f]
const rotateCCW = ([a,b,c,d,e,f,g,h,i])=>[b,c,f,a,e,i,d,g,h]

Then you can have an internal representation, and every click event you rotate your internal array and render them all.

— Can anyone explain this obfuscated variable declaration in JavaScript:

— let allH2 = document.getElementsByTagName("h2");
for (let i = 0; i < allH2.length; i++) {

Message permanent page

— The id is unique. you cannot assign the same ID to multiple items, only one per page can have a specific ID.

Message permanent page

— Please check properly.
I didn't use Id.
The id is for a different purpose

— I later injected it through js and it worked perfectly

— But I will still like to know how to do the DOM selection incase of next time😁

— Select using the id, class or tag name

— Https://

— Sup bro, did andela invite u?

— How to write code for couple expired in Javascript