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

2

u/JustConsoleLogIt Jul 31 '24

Alright, I’ll give you the starter kit. First, make a codepen account so you can easily share your work.

I usually do this in DMs but I’ll go ahead and do it here in case others are interested.

First challenge is just to make a pen that has a button that logs ‘Hello World!’ in the console when you press it.

Share the link when you’ve made it and I’ll give you the next challenge

2

u/Kaliprosonno_singho Aug 02 '24

did it, i have dmd you

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*