What are the Advantages of React JS?
1 What do you know about Flux?
Flux is micro-architecture for software application development, which has unidirectional data flow. It sounds quite abstract but that’s what it is. It is technology agnostic, which means that it doesnt depend on React JS, although it was initially introduced by facebook.
Q1 What is the purpose of ‘This’ operator in JavaScript?
The JavaScript this keyword refers to the object it belongs to. This has different values depending on where it is used. In a method, this refers to the owner object and in a function, this refers to the global object.
Q What are the data types supported by JavaScript?
The data types supported by JavaScript are:
Q1 What are the variable naming conventions in JavaScript?
The following rules are to be followed while naming variables in JavaScript:
Q2 What is a Typed language?
Typed Language is in which the values are associated with values and not with variables. It is of two types:
Q3 What are Exports & Imports?
Imports and exports help us to write modular JavaScript code. Using Imports and exports we can split our code into multiple files. For example-
Now with this, we have reached the final section of JS Interview Questions.
Q3 How do JavaScript primitive/object types passed in functions?
One of the differences between the two is that Primitive Data Types are passed By Value and Objects are passed By Reference.
Q1 How to create a cookie using JavaScript?
The simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this-
Syntax :
Q How can you create an object in JavaScript?
JavaScript supports Object concept very well. You can create an object using the object literal as follows −
Q4 What is a prompt box in JavaScript?
A prompt box is a box which allows the user to enter input by providing a text box. The prompt() method displays a dialog box that prompts the visitor for input. A prompt box is often used if you want the user to input a value before entering a page. When a prompt box pops up, the user will have to click either “OK” or “Cancel” to proceed after entering an input value.