Files
adventureland/docs/articles/2-javascript.html
T
2023-10-15 13:06:58 +03:00

19 lines
620 B
HTML

<p>Using Javascript is as simple as:</p>
<div class='code trimnl executeb'>
a=5;
b=7;
c=a*b;
alert(c);
</div>
<p>As you probably guessed, we used Javascript like a Calculator, the above program alerts "35".</p>
<p>Some more explanation:</p>
<div class='code'>
a=5; // "a" is now a variable that holds the value 5
b=7; // "b" is now a variable that holds the value 7
c=a*b; // "c" is a new variable, it's calculated as 5x7 - it's equal to 35, it's the value it's holding now
alert(c); // "alert" is a function that makes the browser pop up whatever you put in there, annoyingly, you probably saw them before :)
</div>