1 2 3 4 5 6 7 |
|
Find the mistake in the above JavaScript code. Click the type of error, followed by the line in which it occurs.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I don't know very much about javascript
Log in to reply
I guess it isn't available in Brilliant either, is it?
But if you're interested, here's a free website - https://www.w3schools.com/
Log in to reply
Yeah! This is a very good website. I use it when I get stuck, it’s good for website creation. If you use [ linktext ] (https://www.w3schools.com/ ) without spaces: linktext . And here is a good website: e-olymp
Log in to reply
@A Former Brilliant Member – Thanks for the e-olymp and teaching me how to insert links. I'm guessing you already know about w3schools.
Log in to reply
@A Former Brilliant Member – Yes. And what about you?(e-olymp) You can solve interesting problems.
Log in to reply
@A Former Brilliant Member – E-Olymp is new for me. Thanks so much!
Log in to reply
@A Former Brilliant Member – The biggest problem with this website there are a couple of good tasks in Ukrainian or Russian. What about this problem: link ? Brute-force or you can make a formula or recursive solution?
Log in to reply
@A Former Brilliant Member – I'm more of a brute-force person than a think about it person. I'm impatient so i can't wait long enough to use algebra. i just start guessing.
Log in to reply
@A Former Brilliant Member – Ok, but in these problems there are time limits :) My brother used the simple brute-force(start from 1) and it doesn't work. So you should use brute-force in the powers.
@A Former Brilliant Member – Is the answer 6? Because if n = 6 a, b = 2,3 and k=1
Log in to reply
@A Former Brilliant Member – The k is given and you should calculate the n.
@Páll Márton - You were wrong, Hamza Anushath is a girl, she told me.
Log in to reply
I know it too:
Log in to reply
bad picture
Log in to reply
@A Former Brilliant Member – wher did you see this??
Log in to reply
@A Former Brilliant Member – Secret
@Páll Márton , did my account have any weird messages anywhere, my older cousin was using my pc for two minutes, but he said he didn't touch brilliant, but i don't trust him so did he do anything??
Log in to reply
Please help me, if he did something stupid and gave wrong solutions i have to delete them.
Log in to reply
Damn it, i hope they don't see that, im on my ipad and i can't delete them for some reason.(stupid excuse of a cousin)
Log in to reply
@A Former Brilliant Member – I have 5 cousins. And only one is normal.
Log in to reply
@A Former Brilliant Member – Bye! I don't have too much time.
Problem Loading...
Note Loading...
Set Loading...
The answer is Scope, Line 6.
For those of you who don't know what scope is - The scope of a variable is the places in the code where it can be used.
For example :
The 'number2' was defined as a variable in the if condition from line 3 to 5. This means I can only use it inside that if condition.
This is called a local variable.
The variable 'number1' is defined outside of any function or condition, which allows it to be used everywhere.
This is called a global variable.
Thus, the answer is Scope, Line 6 as the local variable 'number2' is being used out of its scope.