JavaScript Question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

JavaScript Question

Was playing the game and tried to test an answer so I can see what is happening, but I can’t get it to work: Once working, I wanted to print every value I returns to see what’s happening. https://code.sololearn.com/W8L6j2a73hmR/?ref=app What value is printed, which is apparently 6

10th Dec 2017, 8:28 AM
Phil Cook
Phil Cook - avatar
2 Answers
+ 11
correct js code: var obj = { arr: [1,2,3], num:1 }; for (var i=0; i<obj.arr.length; i++) { obj.num *= obj.arr[i]; } document.write(obj.num);
10th Dec 2017, 8:32 AM
Cool Codin
Cool Codin - avatar
- 1
I am just a beginner.. working on html with vbscript.. Can anyone explain what's happening.. what should i do to print value of the variables? <script lang="vbscript"> dim a a=2 document.write(a) </script> 👆👉output: empty screen <script lang="vbscript"> document.write("a") </script> 👆👉output: a <script lang="vbscript"> dim a document.write("a") </script> 👆👉output: empty screen
10th Dec 2017, 10:44 AM
Priyan
Priyan - avatar