Using the setInterval() function in JavaScript

  Рет қаралды 45,031

dcode

dcode

Күн бұрын

Пікірлер: 55
@relkovic10
@relkovic10 3 жыл бұрын
The sound of your keyboard is just beautiful.
@AsimYilan
@AsimYilan 4 жыл бұрын
Thank u 4 this Video Tutorial. But i have a problem with: When i click Start or Pause Button second time, i cant started oder paused again. Can u Help me?
@tt9378
@tt9378 4 жыл бұрын
Nice one. Was scratching my head about setInterval but you have given a few pointers. Cheers.
@dcode-software
@dcode-software 4 жыл бұрын
No worries mate
@GerardSiebels
@GerardSiebels 4 жыл бұрын
Amazing! Best tutorial for setInterval I’ve seen! Thanks!
@sahadatsajib8708
@sahadatsajib8708 4 жыл бұрын
Thanks Domb, But finally I face a new problem, when i pressed double or more click our start button, then this function didn't work properly (rapid counting),, so Man whats i can do,,??🤔
@dcode-software
@dcode-software 4 жыл бұрын
You could try having a look at using "clearInterval"
@aniketjadhav7885
@aniketjadhav7885 4 жыл бұрын
I'm also facing the same problem..i tried different things but it didn't work if you have any suggestion just let me know
@Zackemcee1
@Zackemcee1 3 жыл бұрын
Same issue here The more you press the start button the faster the counting will be... It's like a loop but only with the counting part, when you pause it, you're only able to slow down once...
@bassam.2023
@bassam.2023 4 жыл бұрын
Needed this. Thank you.
@iliashterev38
@iliashterev38 4 жыл бұрын
Interesting, I did not know that clearInterval is keeping track of the numbers passed and it would go further instead of starting from zero again. And so I thought that you will need to get the number from the timerText and re-assign it to count before continue. You tutorial is very good. I am sorry that you are not having more likes. You deserve more.
@emreozgun3846
@emreozgun3846 3 жыл бұрын
well count is global in this example. nothing to do with set/clear interval. am I missing something ?
@iliashterev38
@iliashterev38 3 жыл бұрын
@@emreozgun3846 Well, yes, that is right. Thank you. I do not even remember writing this. I must have been sleeping :)
@emreozgun3846
@emreozgun3846 3 жыл бұрын
@@iliashterev38 all good :)
@rafaelribeiro8215
@rafaelribeiro8215 3 жыл бұрын
Hello, i have a problem when i try to run the code. I can't run the code because he said "Cannot read property 'addEventListener' of null" can u help me pls? Thank you.
@acethomas5774
@acethomas5774 4 жыл бұрын
Do you know how to do scripts for different functions for an online game I’ll give you an example javascript:setInterval(function()%7BStreetWarsRaidDialog.attack(0)%7D,20),setInterval(function()%7BStreetWarsRaidDialog.attack(1)%7D,20),setInterval(function()%7BStreetWarsRaidDialog.attack(2)%7D,20),setInterval(function()%7BStreetWarsRaidDialog.attack(3)%7D,20),setInterval(function()%7BStreetWarsRaidDialog.attack(4)%7D,20); but there’s other things you can do on the game also that I don’t know how to write a JavaScript for them I just need help on it if at all possible
@sodiqayilara1519
@sodiqayilara1519 3 жыл бұрын
Very helpful video, thank you.
@dcode-software
@dcode-software 3 жыл бұрын
You're welcome!
@padmapriyavks5560
@padmapriyavks5560 4 жыл бұрын
If there are four side signal with two colours red and green. It want to be automatically rotate in clockwise using setinterval and clearinterval when green is on, others want to be red how can I do this. Can any one help me to do this?
@Igor-vk8fl
@Igor-vk8fl Жыл бұрын
But there is a problem. If you click multiple times on the "start timer" it will execute multiple times the function and the numbers start to get counting faster. Even if you click on "Pause timer the same amaount of imes you click on "start timer" it wont stop.
@wesleyknudson2540
@wesleyknudson2540 Жыл бұрын
did you solve this issue? i got the same
@gabitoth8386
@gabitoth8386 3 жыл бұрын
Thanks a lot!!
@wiesawzamelski1661
@wiesawzamelski1661 3 жыл бұрын
This video is super. Thanks.
@dcode-software
@dcode-software 3 жыл бұрын
Thanks mate
@alifsuria2485
@alifsuria2485 4 жыл бұрын
Can you show how to use parameter in setInterval()?
2 жыл бұрын
Simple and straightforward code, it solved my problem. Great tutorial!
@vaclavvlcek4527
@vaclavvlcek4527 3 жыл бұрын
Thank you for this video, it helped me to understand that matter.
@gfddgitgud3848
@gfddgitgud3848 2 жыл бұрын
Thanks !
@viv_7475
@viv_7475 3 жыл бұрын
Great VIdeo!
@baxti7
@baxti7 6 ай бұрын
class
@beastbwoyi7079
@beastbwoyi7079 4 жыл бұрын
Your name is DOM?👌👌😂
@letsdev5261
@letsdev5261 3 жыл бұрын
awesome
@mohammedjoubba318
@mohammedjoubba318 4 жыл бұрын
Thank you so much
@dcode-software
@dcode-software 4 жыл бұрын
No problem!
@Sawk-cy7wz
@Sawk-cy7wz 2 жыл бұрын
👌
@YoungmeePark1103
@YoungmeePark1103 4 жыл бұрын
Best of best !!!
@colindante5164
@colindante5164 2 жыл бұрын
Thanks a whole bunch))
@dcode-software
@dcode-software 2 жыл бұрын
No problem!!
@stf8375
@stf8375 4 жыл бұрын
Thanks you a lote!
@frostynemz
@frostynemz 4 жыл бұрын
thank you, very helpful
@amirhoxha6231
@amirhoxha6231 3 жыл бұрын
This helped alot
@Moe.firouzabadi
@Moe.firouzabadi 4 жыл бұрын
Thank you !
@cadillacman3790
@cadillacman3790 3 жыл бұрын
great tutorial ! Thanks !
@dcode-software
@dcode-software 3 жыл бұрын
You're welcome.
@chvishnu43
@chvishnu43 5 жыл бұрын
Sir please provide 120 seconds time kill JavaScript
@dcode-software
@dcode-software 5 жыл бұрын
I'm sorry I don't know what you mean, can you explain in a bit more detail?
@chvishnu43
@chvishnu43 5 жыл бұрын
Open the URL Sir
@chvishnu43
@chvishnu43 5 жыл бұрын
U will find out 20 seconds timer often login but decrease time 20 to 5 seconds please using JavaScript
@dcode-software
@dcode-software 5 жыл бұрын
20000 milliseconds is 20 seconds so you need to change 20000 to 5000
@chvishnu43
@chvishnu43 5 жыл бұрын
Yes sir
@MusicEffekt
@MusicEffekt 3 жыл бұрын
please record with a larger font size so that the codes are more readable on screen. Thanks
The Importance of THIS in Javascript
22:59
developedbyed
Рет қаралды 22 М.
Spongebob ate Michael Jackson 😱 #meme #spongebob #gmod
00:14
Mr. LoLo
Рет қаралды 10 МЛН
The joker favorite#joker  #shorts
00:15
Untitled Joker
Рет қаралды 30 МЛН
Man Mocks Wife's Exercise Routine, Faces Embarrassment at Work #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 6 МЛН
setTimeout() and setInterval() - JavaScript Tutorial
8:21
OpenJavaScript
Рет қаралды 9 М.
getBoundingClientRect() in Javascript DOM
9:19
dcode
Рет қаралды 49 М.
Storing Objects with Local Storage in JavaScript
6:58
dcode
Рет қаралды 169 М.
Learn JavaScript SWITCHES in 6 minutes! 💡
6:45
Bro Code
Рет қаралды 19 М.
9.4: JavaScript setTimeout() Function - p5.js Tutorial
9:20
The Coding Train
Рет қаралды 129 М.
Async JavaScript & Callback Functions -- Tutorial for Beginners
24:21
Bind Explained in JavaScript
7:05
dcode
Рет қаралды 82 М.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
A stopwatch written in JavaScript ⏱️
12:14
Bro Code
Рет қаралды 32 М.