React JS
React JS
React JS
ReactDOM.render(<h1>hi</h1>,document.getElementById(“root”))
JSX-Javascript xml
(like writing a html in js)
Return object notation
REACT COMPONENT
Pascal case
Function that return react elements,reusable
Combining the html elements into a single component and that can
be reused .eg:<Navbar />
Vite
Frontend modern tool provide extreme faster development of the
environment and bundle up the code
NODE JS
Create real time applications,
Provide server side runtime environment for javascript
run in JSengine(add additional power to your js code)
JS INSIDE JSX=> if u want to use js inside jsx use with the help of {}
{ js variable}
PROPS
Properties being passed to a component inorder to work correctly similar like function
receiving the parameter
Create reusable custom components(<MyAwesomeHeader title="???" />)
Datatype object
Receive props(function Navbar(props))
Array.map()
Create a new array from calling a function for every element
indexOf()
Return the index of occurrence of the first element
Eg:const a=[5,2,3,2,1,1]
a.indexOf(2)//1 is the index of 2
filter()
Return a new array that satisfy the condition
syntax:array.filter(callback function(element))
callback function()=to run every element in the array
Element = required parameter represent the element in the array
Eg
Let age=[23,43,17,2,1]
Function age(age){
return age>18
}
Let res=age.filter(age)
console.log(res)
//[23,43]