loading...

re: Use $ & $$ Instead of document.querySelector/All in JavaScript without jQuery VIEW POST

TOP OF THREAD FULL DISCUSSION
re: This looks cool. with you example could you still do this though? const username = 'johndoe' const age = 32 console.log(`The name of the user i...
 

Yep, it would look like this:

const username = 'johndoe'
const age = 32

console.log(`The name of the user is ${username} and his age is ${age}.`)
console.log(`Element is: ${$('#article-reaction-actions')}.`)

The outer $ in the template string will start the evaluation. the $ inside of ${} will refer to the global $.

Hope this clears it up!

Code of Conduct Report abuse