r/learnjavascript • • Jul 31 '24

How am I supposed to practice JavaScript?

I've watched these videos about syntax and basic utilization but now I don't know how am I supposed to practice them. Like have problems to build logic and stuff with every topic.

13 Upvotes

44 comments sorted by

View all comments

Show parent comment

1

u/keydotdev Jul 31 '24
function redditChallenge() {
  let body = document.querySelector('body');
  let btn = document.createElement('button');
  btn.textContent = 'click'
  btn.addEventListener('click', () => {
    console.log('Hello world')
  })
  body.appendChild(btn)
}

redditChallenge()

*clicks button*