Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11631

New to javascript and need assistance [closed]

$
0
0

I'm brand new to scripting with JavaScript. I just obtained my ServiceNow CSA cert and I'm not enrolled in Scripting Fundamentals to work towards my Certified Application Developer cert in ServiceNow.

Being relatively new to scripting, I need a little help! I'm working on one of the labs that help you learn concepts and I can't figure out what the problem is with the Syntax. Below is my current code:

//Script used to practice Syntax Checkingvar peripherals = ["keyboard", "mouse", "printer", "speakers"];var myNum = .5;for (var i = 0, i < peripherals.length, i++) {    alert("Current peripheral is: " + peripherals[i]);}if (myNum) {    myNum++;    alert("myNum: ", myNum);}

I'm getting " ',' expected" on i < peripherals.lengthGetting "identifier expected" on the comma after "length"Also getting "identifier expected" on the first "+" after the "i"And getting "expression expected" on the last "+".

Any help would be appreciated and as I'm new to all of this, could you please try to explain it in layman's terms? Thank you!

I was trying to accomplish this lab and am having no success.


Viewing all articles
Browse latest Browse all 11631

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>