• +91 9723535972
  • info@interviewmaterial.com

JavaScript Framework Interview Questions and Answers

JavaScript Framework Interview Questions and Answers

Question - 1 : - . What is JavaScript?

Answer - 1 : - JavaScript is a lightweight, interpreted programming language with object-oriented capabilities that allows you to build interactivity into otherwise static HTML pages. The general-purpose core of the language has been embedded in Netscape, Internet Explorer, and other web browsers.

Question - 2 : - What are the data types supported by JavaScript?

Answer - 2 : - The data types supported by JavaScript are: • Undefined • Null • Boolean • String • Symbol • Number • Object

Question - 3 : - What are the features of JavaScript?

Answer - 3 : - Following are the features of JavaScript: • It is a lightweight, interpreted programming language. • It is designed for creating network-centric applications. • It is complementary to and integrated with Java. • It is an open and cross-platform scripting language.

Question - 4 : - Is JavaScript a case-sensitive language?

Answer - 4 : - Yes, JavaScript is a case sensitive language. The language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.

Question - 5 : - What are the advantages of JavaScript?

Answer - 5 : - Following are the advantages of using JavaScript − • Less server interaction − You can validate user input before sending the page off to the server. This saves server traffic, which means less load on your server. • Immediate feedback to the visitors − They don’t have to wait for a page reload to see if they have forgotten to enter something. • Increased interactivity − You can create interfaces that react when the user hovers over them with a mouse or activates them via the keyboard. • Richer interfaces − You can use JavaScript to include such items as drag-and-drop components and sliders to give a Rich Interface to your site visitors.

Question - 6 : - What is the purpose of ‘This’ operator in JavaScript?

Answer - 6 : - 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.

Question - 7 : - What are the variable naming conventions in JavaScript?

Answer - 7 : - The following rules are to be followed while naming variables in JavaScript: 1. You should not use any of the JavaScript reserved keyword as variable name. For example, break or boolean variable names are not valid. 2. JavaScript variable names should not start with a numeral (0-9). They must begin with a letter or the underscore character. For example, 123name is an invalid variable name but _123name or name123 is a valid one. 3. JavaScript variable names are case sensitive. For example, Test and test are two different variables.

Question - 8 : - How to read a cookie using JavaScript?

Answer - 8 : - Reading a cookie is just as simple as writing one, because the value of the document.cookie object is the cookie. So you can use this string whenever you want to access the cookie. • The document.cookie string will keep a list of name = value pairs separated by semicolons, where name is the name of a cookie and value is its string value. • You can use strings’ split() function to break the string into key and values.

Question - 9 : - What are the ways to define a variable in JavaScript?

Answer - 9 : - The three possible ways of defining a variable in JavaScript are: • Var – The JavaScript variables statement is used to declare a variable and, optionally, we can initialize the value of that variable. Example: var a =10; Variable declarations are processed before the execution of the code. • Const – The idea of const functions is not allow them to modify the object on which they are called. When a function is declared as const, it can be called on any type of object. • Let – It is a signal that the variable may be reassigned, such as a counter in a loop, or a value swap in an algorithm. It also signals that the variable will be used only in the block it’s defined in.

Question - 10 : - In how many ways a JavaScript code can be involved in an HTML file?

Answer - 10 : - There are 3 different ways in which a JavaScript code can be involved in an HTML file: • Inline • Internal • External An inline function is a JavaScript function, which is assigned to a variable created at runtime. You can differentiate between Inline Functions and Anonymous since an inline function is assigned to a variable and can be easily reused. When you need a JavaScript for a function, you can either have the script integrated in the page you are working on, or you can have it placed in a separate file that you call, when needed. This is the difference between an internal script and an external script.

NCERT Solutions


Share your email for latest updates


Our partners