Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
College aantekeningen

Mern stack question and answers_ node_react_express

Beoordeling
-
Verkocht
-
Pagina's
32
Geüpload op
09-02-2023
Geschreven in
2022/2023

I have written the detailed notes which includes the all the possible question for the course with the detailed answers. the course name is web technologies and the title of the topic is Mern stack. In the notes, I have tried my best to cover all the topics including JavaScript, react, express and node

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

Differentiate between Real DOM and Virtual DOM.
Real DOM vs Virtual DOM
Real DOM Virtual DOM
1. It updates slow. 1. It updates faster.
2. Can directly update HTML. 2. Can’t directly update HTML.
3. Creates a new DOM if element updates. 3. Updates the JSX if element updates.
4. DOM manipulation is very expensive. 4. DOM manipulation is very easy.
5. Too much of memory wastage. 5. No memory wastage.


3. What are the features of React?
Major features of React are listed below:
i. It uses the virtual DOM instead of the real DOM.
ii. It uses server-side rendering.
iii. It follows uni-directional data flow or data binding.


4. List some of the major advantages of React.
Some of the major advantages of React are:
i. It increases the application’s performance
ii. It can be conveniently used on the client as well as server side
iii. Because of JSX, code’s readability increases
iv. React is easy to integrate with other frameworks like Meteor, Angular, etc
v. Using React, writing UI test cases become extremely easy
5. What are the limitations of React?
Limitations of React are listed below:
i. React is just a library, not a full-blown framework
ii. Its library is very large and takes time to understand
iii. It can be little difficult for the novice programmers to understand
iv. Coding gets complex as it uses inline templating and JSX




6. What is JSX?
JSX is a shorthand for JavaScript XML. This is a type of file used by React which
utilizes the expressiveness of JavaScript along with HTML like template syntax. This
makes the HTML file really easy to understand. This file makes applications robust and
boosts its performance. Below is an example of JSX:
1 render(){
return(
2

, 3
4 <div>
5
6 <h1> Hello World from Edureka!!</h1>
7
8 </div>
9
10 );
}
11
7. What do you understand by Virtual DOM? Explain its working.
A virtual DOM is a lightweight JavaScript object which originally is just the copy of the
real DOM. It is a node tree that lists the elements, their attributes and content as
Objects and their properties. React’s render function creates a node tree out of the
React components. It then updates this tree in response to the mutations in the data
model which is caused by various actions done by the user or by the system.
This Virtual DOM works in three simple steps.
1. Whenever any underlying data changes, the entire UI is re-rendered in Virtual
DOM representation.




2. Then the difference between the previous DOM representation and the new one




is calculated.

, 3. Once the calculations are done, the real DOM will be updated with only the




things that have actually changed.
8. Why can’t browsers read JSX?
Browsers can only read JavaScript objects but JSX in not a regular JavaScript object.
Thus to enable a browser to read JSX, first, we need to transform JSX file into a
JavaScript object using JSX transformers like Babel and then pass it to the browser.




12. Explain the purpose of render() in React.
Each React component must have a render() mandatorily. It returns a single React
element which is the representation of the native DOM component. If more than one
HTML element needs to be rendered, then they must be grouped together inside one
enclosing tag such as <form>, <group>,<div> etc. This function must be kept pure i.e.,
it must return the same result each time it is invoked.
13. How can you embed two or more components into one?
We can embed components into one in the following way:
1 class MyComponent extends React.Component{

2 render(){

, 3
return(
4

5
<div>
6

7
<h1>Hello</h1>
8

9
<Header/>
10
</div>
11

12 );
13 }
14 }

15 class Header extends React.Component{

16 render(){

return
17

18
<h1>Header Component</h1>
19

20
};
21
}
22
ReactDOM.render(
23
<MyComponent/>, document.getElementById('content')
24 );
25

14. What is Props?
Props is the shorthand for Properties in React. They are read-only components which
must be kept pure i.e. immutable. They are always passed down from the parent to the
child components throughout the application. A child component can never send a prop
back to the parent component. This help in maintaining the unidirectional data flow and
are generally used to render the dynamically generated data.
15. What is a state in React and how is it used?

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
9 februari 2023
Aantal pagina's
32
Geschreven in
2022/2023
Type
College aantekeningen
Docent(en)
Usman
Bevat
Alle colleges

Onderwerpen

$11.09
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
muhammadshoaib3

Maak kennis met de verkoper

Seller avatar
muhammadshoaib3 COMSATS University Islamabad
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
3 jaar
Aantal volgers
0
Documenten
1
Laatst verkocht
-

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen