skip to Main Content

javascript new and this keyword

I have been given a task at my internship , I have to create math operations like plus(), minus() etc. using this and new keywords. example:- one().plus().two().equalTo() , given line of code must return 3. I tried creating functions which…

VIEW QUESTION

Javascript – How to assign different audio to different buttons after clicked event

<h1 id="title">Drum 🥁 Kit</h1> <div class="set"> <button class="w drum">w</button> <button class="a drum">a</button> <button class="s drum">s</button> <button class="d drum">d</button> <button class="j drum">j</button> <button class="k drum">k</button> <button class="l drum">l</button> </div> var tekan = document.querySelectorAll(".drum"); tekan.forEach(drum => { drum.addEventListener("click", play); }) function play()…

VIEW QUESTION
Back To Top
Search