Hey friends. If I want to repeat same code after ending what should I do? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hey friends. If I want to repeat same code after ending what should I do?

5th Oct 2020, 12:47 PM
RD:programmer
RD:programmer - avatar
12 Answers
+ 1
Check out this code https://code.sololearn.com/WmkHemqyS4Om/?ref=app The problem is that the function will loop forever.
5th Oct 2020, 1:28 PM
Wagner Alves dos Santos
Wagner Alves dos Santos - avatar
+ 2
What, after ending course
5th Oct 2020, 12:58 PM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 1
See this code == var a =prompt("write your doubt"," "); if (a==maths){ alert ("yes")} else {alert("no")} /*what should i do ,if i want that after the conditional loop ended then it repeated all code again from var a to }*/
5th Oct 2020, 1:15 PM
RD:programmer
RD:programmer - avatar
+ 1
"For" method.
5th Oct 2020, 1:16 PM
Wagner Alves dos Santos
Wagner Alves dos Santos - avatar
+ 1
Declare a function and call her inside the function e.g. function a() { some code... // in the end call the function a() }
5th Oct 2020, 1:52 PM
Wagner Alves dos Santos
Wagner Alves dos Santos - avatar
0
"For" method is for loop 🤔🤔🤔🤔
5th Oct 2020, 1:20 PM
RD:programmer
RD:programmer - avatar
0
Give a short example ,friend please .
5th Oct 2020, 1:20 PM
RD:programmer
RD:programmer - avatar
0
Most thanks to you....can you send me a pdf or other sources where this method is explained .
5th Oct 2020, 1:41 PM
RD:programmer
RD:programmer - avatar
0
What method?
5th Oct 2020, 1:43 PM
Wagner Alves dos Santos
Wagner Alves dos Santos - avatar
0
That method which is use for repeated code again and again
5th Oct 2020, 1:48 PM
RD:programmer
RD:programmer - avatar
0
Put it in a,function (a) and do a()a()
6th Oct 2020, 9:47 PM
JO Jo
JO Jo - avatar
0
Just use for loop or while loop
7th Oct 2020, 2:36 AM
Ashutosh Pattnaik
Ashutosh Pattnaik - avatar