What is the scope of the variable pen on line 6? var pen = “Bic”; var pencil = “0.7 mm lead”; function writeIt() { document.write(“I have a ” + pen + ” pen.”); pen = “Flair”; document.write(“You have a ” + pen + ” pen.”); var pencil = “0.5mm lead”; document.write(“I prefer pencils with ” + pencil); }
Blog
Given that Y is a numeric variable, which of the following…
Given that Y is a numeric variable, which of the following is NOT equivalent to: (Y
Which of the following is NOT a valid variable name?
Which of the following is NOT a valid variable name?
Which is not a method of the Date() object?
Which is not a method of the Date() object?
Which of the following will generate a random number between…
Which of the following will generate a random number between 1 and 6?
In the code given, which are the parameters and which are th…
In the code given, which are the parameters and which are the arguments? function product(x.y); { return (x * y); } myNum = product(5, 10);
What integer values of x would make the following statement…
What integer values of x would make the following statement true? (x >= 2) && (x < 6)
What will display after the following code is run if name =…
What will display after the following code is run if name = “Morris”? if(name > “Joe”) document.write(“Morris is a cat.”); else document.write(“Joe rules!”);
What are the arguments and parameters in the code snipped? …
What are the arguments and parameters in the code snipped? var shirt = “blue”; var pants = “gray”; var clothes = wearIt(shirt, pants); function wearIt( x, y) { var myOutfit = “Today I will wear a ” + pants + 8 ” shirt and ” + shirt + ” pants.”; return myOutfit; } document.write(clothes);
Which statement is equivalent to the following: (x…
Which statement is equivalent to the following: (x >= 0) && (x