+ 3
function sum(n){for(var i = 1;i>= 5;i++ ){ let n=0; n+=i;}} console.log(sum()) //where is the mistake .why does it not work? //t
Tell where the mistake is please
55 odpowiedzi
+ 15
i<=5 💻
+ 7
There is no "return" in your function
+ 2
Ouch.. sorry about that. Just i was hurried and named it with the first thing i thought about😳😳
+ 2
Patel Ashish we solve it already😃
+ 1
*to have👆
+ 1
Well, check my code again, i remade it again 😂😂😂
+ 1
Thanks, i did it😃
0
Let me try it . Thanks
0
Try it. If that's the thing you wanna get🤔
0
Thanks so much it so good to people like you
0
Hi Nazeek after some tinkering I managed to make add all integers up to n
https://code.sololearn.com/WX2Dfe1JckHG/?ref=app
0
Yeap, thats kinda smart😃 I think you can also do it available for users to choose a number. The easiest way is to use "prompt" i guess 🤔🤔
0
Iam still still a novice to be honest. I don't know how it's done
0
Nazeekk please, stop using expletives anywhere.
0
Wow😅 That's a function to get user input. Just like:
let x = prompt()
alert(x)
So here when we enter data, the "x" variable will have user's value
0
Nazeekk Let me incorporate that into my code thanks
0
Check my link again. I remade it😃😃 So.. as i can get, you made smth kinda "factorial calculator"?🤔
0
Ok
0
Wow 😃 it works