JavaScript Flashcards

1
Q

What is JavaScript?

A

JavaScript is a client-side as well as server side scripting language that can be inserted into HTML pages and is understood by web browsers. JavaScript is also an Object based Programming language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are JavaScript Data Types?

A

Following are the JavaScript Data types:

Number
String
Boolean
Object
Undefined
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the use of isNaN function?

A

isNan function returns true if the argument is not a number otherwise it is false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which company developed JavaScript?

A

Netscape is the software company who developed JavaScript.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are undeclared and undefined variables?

A

Undeclared variables are those that do not exist in a program and are not declared. If the program tries to read the value of an undeclared variable, then a runtime error is encountered.

Undefined variables are those that are declared in the program but have not been given any value. If the program tries to read the value of an undefined variable, an undefined value is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is ‘this’ keyword in JavaScript?

A

‘This’ keyword refers to the object from where it was called.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are all the looping structures in JavaScript?

A

Following are looping structures in Javascript:

For
While
do-while loops

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can you convert the string of any base to integer in JavaScript?

A

The parseInt() function is used to convert numbers between different bases. parseInt() takes the string to be converted as its first parameter, and the second parameter is the base of the given string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain the difference between the double equals operator(“==”) and the triple equals operator (“===”)?

A

”==” checks only for equality in value whereas “===” is a stricter equality test and returns false if either the value or the type of the two variables are different.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What do mean by NULL in Javascript?

A

The NULL value is used to represent no value or no object. It implies no object or null string, no valid boolean value, no number and no array object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is an undefined value in JavaScript?

A

Undefined value means the

Variable used in the code doesn’t exist
Variable is not assigned to any value
Property doesn’t exist

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between an alert box and a confirmation box?

A

An alert box displays only one button which is the OK button.

But a Confirmation box displays two buttons namely OK and cancel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are JavaScript Cookies?

A

Cookies are the small test files stored in a computer and it gets created when the user visits the websites to store information that they need. Example could be User Name details and shopping cart information from the previous visits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which keyword is used to print the text in the screen?

A

document.write(“Welcome”) is used to print the text – Welcome in the screen.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the use of Push method in JavaScript?

A

The push method is used to add or append one or more elements to the end of an Array. Using this method, we can append multiple elements by passing multiple arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What boolean operators can be used in JavaScript?

A

The ‘And’ Operator (&&), ‘Or’ Operator (||) and the ‘Not’ Operator (!) can be used in JavaScript.

17
Q

What is an AJAX call?

A

AJAX stands for Asynchronous JavaScript And XML. In a nutshell, it is the use of the XMLHttpRequest object to communicate with servers. It can send and receive information in various formats, including JSON, XML, HTML, and text files.

18
Q

What are synchronous and asynchronous calls?

A

Synchronous: If an API call is synchronous, it means that code execution will block (or wait) for the API call to return before continuing. … Asynchronous calls do not block (or wait) for the API call to return from the server.

19
Q

Is an AJAX call asynchronous?

A

Yes. AJAX stands for asynchronous JavaScript and XML,

20
Q

what is a promise in JavaScript?

A

A promise is an object that may produce a single value some time in the future : either a resolved value, or a reason that it’s not resolved (e.g., a network error occurred). A promise may be in one of 3 possible states: fulfilled, rejected, or pending.

21
Q

What protocol is REST built around?

A

REST uses the HTTP Protocol.

22
Q

What are “Normal Forms” in databasing?

A

Normal forms are used to eliminate or reduce redundancy in database tables.

23
Q

What does REST stand for?

A

REST stands for Representational State Transfer.

24
Q

How can you tell what browser is being used in JS?

A

JavaScript has a standard object called navigator that contains data about the browser being used.

25
Q

What is a Polyfill?

A

A polyfill is a piece of code used to provide modern functionality on older browsers that do not natively support it. … The polyfill uses non-standard features in a certain browser to give JavaScript a standards-compliant way to access the feature.

26
Q

What is the difference between “var” and “let”?

A

Let uses block scope, while Var uses hoisting when loading.

27
Q

What are the data types in JavaScript?

A

Boolean, String, Number, Null, Undefined, BigInt, Symbol, and Object.

28
Q

How are JavaScript Numbers stored?

A

JavaScript numbers are always stored as double precision floating point numbers, following the international IEEE 754 standard.