Strict mode

Strict mode is a special mode that user can activate in JS which makes it easier for us to write a secure JS code.
All user needs to activate this strict mode is to write this at the beginning of the script.
‘use strict’;
Without strict mode, JS will fail silently without letting user know that there is a mistake.

Function declarations vs Expressions

Just like a variable starts with ‘var/let /const’, function declaration also should begin with ‘function’ and it is used as function name to invoke the function.

function age1(year) {return 2020-year;}

Function expression is stored in a variable.


I wanted to take a full stack web course in Udacity and in order to start, I should be able to write codes with object oriented language. Since I’ve only studied C language, I decided to take JS course in Udemy beforehand.

3 ways of variable declaration — var, let, const

1. Var
Var can be re-declared later and it is also mutable. However, It is not good practice to use this and leave a potential to create a bug later. Var is old way of declaring variable so that it is not used as often.

2. Let Let is used to declare any types of variables such as…


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store