Lead Academy PTE
License No. 283870
Supported by javascript we have primitive data types like string, boolean, number, bigint which can represent integers with arbitrary precision and define null symbol we also have object and functions.
Yes, JavaScript is a case-sensitive language. The keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.
JavaScript supports object concepts very well. You can create an object using the object literal as follows in order to create an object use curly braces.
In order to create an array use square brackets.
We can define function declaration by using the function keyword and provide the name of the function. When we assign the function to a variable using function keyword and anonymous function where we do not provide the name of the function which makes it a little bit more difficult to call them from other places.
The type of operator is used to get the data type of its operand, the operand can be either a litterer or a data structure such as a variable, a function, or an object. An arrow operator that is placed before its single operand which can be of any type its value is a string indicating the type of the operand.
The simplest way to create a cookie is to assign a string value to a document.cookie object.
JavaScript has two visually similar yet very different ways to test equality. You can test equality with double or triple. Equal sign here is the difference. When using a triple equals in javascript we are testing for strict equality which means that both type and the value we are comparing have to be the same. When we use a double equal sign javascript will try to convert values to a like type and then compare the values for that reason usually you would rather use a triple equal sign.
If you open developer tools and navigate to the application tab you can see which storages are available in a chrome web browser. So except for the cookies which you already know you can use local storage or session storage and some browsers but not all of them support internal databases like index database and Web SQL.
In a nutshell, undefined typical means that the variable has been declared but not defined where null is assigned value and it means nothing other than that. Both null and undefined are primitives and they are both falsely values.
So these were the top 10 interview questions that you might hear on your very first interview for a junior developer role.