I am doing Exactly what it says but still it is WRONG. What is Happening?
Your code so far
function myLocalScope() {
var myVar = 5;
console.log(myVar);
}
myLocalScope();
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
.
Challenge: Local Scope and Functions
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
hi @Shadow2
use the above string value for myVar
, instead of 5
What do you mean @sobadrdb ?
the line above say
âuse strictâ;
so myVar = âsomethingâ
1 Like
Cant find that in the code ):
just use string value try myVar='5';
// running tests You should add a local
myVar
variable. // tests completed // console output 5
Click the âReset All Codeâ button to reset the test. DO NOT change anything that is already there. Just add your local variable in the myLocalScope function.
okay, you almost did right
var myVar = 5;
you just have to change it to string
var myVar = '5';
Didnât work, it says it is WRONg
Actually, it doesnât need to be a string. The issue here is not that definition of the local variable. The issue is that other code was changed. If you reset the code and just add the local variable (which can be set to a string or number) it will work.
1 Like
What noo. i dont want to restart all of my code, i am done all only need this to finish it
sory that mean you already change something
That button doesnât reset all of your code, just the code in this challenge.
And yes, that button should be changed to something like âReset Code for this Challengeâ
yea sory, i just copied his.code and paste it to my code tab
Nop, Sigh Did not work, I even copied and pasted from the video (if you wantesd help) And did NOT WORKKK
Please post your new code here.
what code, like the new code, like when you reset it?