ReactJS Flashcards

To learn ReactJS

1
Q

What is Babel

A

It is a JavaScript compiler used to ensured backward compatibility of Javascript(ES6) code

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

What does the command does

A

It is same as . It installs a package and all the dependencies present in package.json

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

What’s the difference between npm install –save and npm install

A

using –save option updates package.json

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

How is CSS property written(set) in Javascrit

A

Any hyphenated CSS property will be written in camelCase in JavaScript

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

What are the three kinds of nodes in DOM

A

Element nodes, text nodes and comment nodes

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

method to access elements by tag

A

document.getElementsByTagName()

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

selector for ID attribute with querySelector method

A
#
Example document.querySelector('demo-query')
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Selector for class attribute with querySelector method

A

.

Example document.querySelector(‘.demo-query-all’)

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

How to comma separated values function in querySelector() method

A

comma separated values function as an OR operator. for example querySelector(‘div,article’) will match div or article, whichever occurs first in the document

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

How to comma separated values function in querySelectorAll() method

A

comma separated values function as an AND operator. for example querySelectorAll(‘div, article’) will match all divs and articles in the document

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

how to retrieve the grandparent node

A

childElement.parentNode.parentNode

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

Which child node properties will fetch only the element nodes

A

children, firstElementChild and lastElementChild

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

What method can be used to create a new HTML element in Javascript

A

document.createElement

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

how do you add text to your html element

A

.textContent or .innerHTML

InnerHTML method can be used to insert both text and HTML to a node but has Cross Site Scripting risk.

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

Method to create a text node

A

document.createTextNode()

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