DEV Community

MD. Badsha Fahadh
MD. Badsha Fahadh

Posted on

Common interview questions that you need to know as a junior JavaScript developer.

What are the various data types that exist in JavaScript?

These are the different types of data that JavaScript supports:
Boolean - For true and false values
Null - For empty or unknown values
Undefined - For variables that are only declared and not defined or initialized
Number - For integer and floating-point numbers
String - For characters and alphanumeric values
Object - For collections or complex values
Symbols - For unique identifiers for objects

What is JavaScript Hoisting?

Hoisting is the default behavior of JavaScript where all the variable and function declarations are
moved on top. This means that irrespective of where the variables and functions are declared,
they are moved on top of the scope. The scope can be both local and global.

What are the features of JavaScript?

These are the features of JavaScript:
Lightweight, interpreted programming language
Cross-platform compatible
Open-source
Object-oriented
Integration with other backend and frontend technologies
Used especially for the development of network-based applications.

What are "null" and "undefined"?

In JavaScript null is an object, where undefined is a type. null means empty. It can be assigned as a value where you don't want to assign any specific value. undefined means when a variable is declared but no value is assigned to it.

What is DOM ??

Document Object Model is a programming interface for HTML and XML. A webpage is an HTML document. We can't manipulate this document with a programming language. So DOM comes into play. DOM is an object-oriented representation of an HTML document. It represents the document as nodes and object which can be manipulated by a programming language such as JavaScript.

JavaScript arrow function.

JavaScript arrow function is shorthand of normal function in JavaScript. But it has some limitations too.

*Does not have its own bindings to this or super, and should not be used as methods.
*Does not have arguments, or new.target keywords.
*Not suitable for call, apply and bind methods, which generally rely on establishing a scope.
*Can not be used as constructors.
*Can not use yield, within its body.

//Traditional Named Function with arguments
function add(x, y) {
  return x + y; 
} 

//Arrow Function 
add (a, b) => {
 return a + b;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)