0% found this document useful (0 votes)
186 views

Javascript Notes

JavaScript programs are lists of programming statements separated by semicolons. Statements can be grouped together in code blocks surrounded by curly brackets. Comments can be added to explain parts of the code. Keywords like var, let, const, if, for, function are used to identify different statement types like variables, conditions, loops, and functions. Variables can be declared using var, let, const, or without a declaration for implicit global variables.

Uploaded by

Arun Vishwakarma
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
186 views

Javascript Notes

JavaScript programs are lists of programming statements separated by semicolons. Statements can be grouped together in code blocks surrounded by curly brackets. Comments can be added to explain parts of the code. Keywords like var, let, const, if, for, function are used to identify different statement types like variables, conditions, loops, and functions. Variables can be declared using var, let, const, or without a declaration for implicit global variables.

Uploaded by

Arun Vishwakarma
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 2

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.

You might also like