Premium Courses

Learn practical web development building multi user SEO blog app in Laravel. A Journey from localhost to live server.

Learn the fastest growing and high in demand React Js in short period of time along with ES6. Build a Newsapp while learning.

A complete beginners guide to Web Development. Master the art of building Responsive web pages with this course. Learn to code from scratch!

JavaScript Syntax - Getting Started with JavaScript Syntax

JavaScript Syntax - Getting Started with JavaScript Syntax

Category: JavaScript   Updated by Ryan Dhungel

Javascript programming language, just like any other programming language has a description of its own that explains how it should work at most basic level. This description typically defines syntax, operators, data types, and built-in functionality upon which complex solutions can be built.

JavaScript’s syntax borrows heavily from C and other C-like languages such as Java and Perl.


An identifier is the:

  • Name of a variable
  • Name of a function
  • Name of a function property
  • Name of a function argument

Strict Mode

Strict mode is a different parsing and execution model for JavaScript.  To enable strict mode for an entire script, include the following at the top:

"use strict";


Statements are terminated by semicolons. If you don't put semicolon yourself, the parser will do it for you. Which can cause performance issues.

var sum = a+b;

Multiple statements can be combined beginning with left curlybraces { and ending with right curlybraces }.

 test = false;


Variable can hold any type of data. It is simply a named placeholder for a value.To define a variable use var. 

To initialize a variable use var operator followed by an identifier like so:

var message; // undefined
var message = “Hi”; 
// assign a different value
message = 100;


Back to articles