JavaScript Flashcards

1
Q

The container (in animation) should be created with the style …… and the animation element should be created in the style ……..

A

position : relative

position : absolute

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

code to display date

A

document.getElementById(“demo”).innerHTML = “Date : “ + Date();

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

Mention the 3 parts of the W3C DOM.

A

Core DOM - standard model for all document types
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML documents

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

what is W3C?

A

world wide web consortium

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

How is HTML DOM model is constructed?

A

As a tree of objects

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

what are templates for js objects

A

js classes

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

mention the keyword that you use when you create class inheritance

A

extends

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

define debugging

A

searching for and fixing errors in programming code// process of testing/ finding and reducing bugs

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

what is breakpoint

A

places where code execution can be stooped

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

what does debugger keyword do?

A

stops the execution of js and (if available) calls the debugging function

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

explain this keyword in regular function

A

In regular functions the this keyword represented the object that called the function, which could be the window, the document, a button or whatever.

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

Explain this keyword in arrow function

A

With arrow functions the this keyword always represents the object that defined the arrow function.

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

explain js modules and its statements

A
  • It allows you to break up your code into seperate files and it relies on import and export statements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what are the two types of exports?

A

There are two types of exports: Named and Default.

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

what does JSON stand for ?

A

JSON stands for JavaScript Object Notation

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

strict mode doesn’t allow ……………

A

undeclared variables

17
Q
1 . let x = 10;
switch(x) {
  case 10: alert("Hello");
}
2.let x = 10;
switch(x) {
  case "10": alert("Hello");
}

which piece of code will display an alert

A

1st one

18
Q

which statement should not be broken?

A

return

19
Q

what are associative arrays?

A

arrays with named indexes

20
Q

what happens when you use named indexes?

A

If you use a named index, when accessing an array, JavaScript will redefine the array to a standard object.

21
Q

How do you extract and display js objects?

A

alert(objectname.property)

22
Q

math method to find largest of two numbers

A

Math.max