JavaScript
<script> js </script>
A computer program is a list of "instructions" to be "executed" by a comp
In a programming language, these programming instructions are called stat
A JavaScript program is a list of programming statements.
Semicolons(;) separate JavaScript statements.
JavaScript ignores multiple spaces. You can add white space to your scrip
A good practice is to put spaces around operators ( = + - * / ):
If a JavaScript statement does not fit on one line, the best place to bre
JavaScript statements can be grouped together in code blocks, inside curl
JavaScript statements often start with a keyword to identify the JavaScri
Comments
//xyz Single line comment
/* xyz */ Multi line comment
Keywords
JavaScript statements often start with a keyword to identify the JavaScri
var Declares a variable
let Declares a block variable
const Declares a block constant
if Marks a block of statements to be executed on a condition
switch Marks a block of statements to be executed in different cases
for Marks a block of statements to be executed in a loop
function Declares a function
return Exits a function
try Implements error handling to a block of statements
Variables
4 Ways to declare a JavaScript Variable
var
let
const
using nothing
ecuted" by a computer.
s are called statements.
ace to your script to make it more readable.
best place to break it is after an operator:
ocks, inside curly brackets {...}.
tify the JavaScript action to be performed.
tify the JavaScript action to be performed.