This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from "react"; | |
function App() { | |
return ( | |
<div> | |
<Users /> | |
</div> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
function App() { | |
return ( | |
<div> | |
<Counter /> | |
</div> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function App() { | |
const products = [ | |
{ name: "Photoshop", price: "$4.00" }, | |
{ name: "Figma", price: "$5.00" }, | |
{ name: "Sketch", price: "$6.00" }, | |
{ name: "After Efects", price: "$26.00" }, | |
{ name: "Premier pro", price: "$96.00" }, | |
]; | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function App() { | |
const products = [ | |
{ name: "Photoshop", price: "$4.00" }, | |
{ name: "Figma", price: "$5.00" }, | |
{ name: "Sketch", price: "$6.00" }, | |
]; | |
return ( | |
<div> | |
<Products |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function App() { | |
return ( | |
<div> | |
<HelloWorld name='Hello World'></HelloWorld> | |
<HelloWorld name='Hello Bangladesh'></HelloWorld> | |
</div> | |
); | |
} | |
function HelloWorld(props) { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function HelloWorld() { | |
return ( | |
<div> | |
<h3>Hello World!</h3> | |
</div> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* inheritance, extends, super */ | |
class Parent { | |
constructor() { | |
this.fatherName = "Christopher Nolan"; | |
this.motherName = "Emma Thomas"; | |
} | |
} | |
class Child extends Parent { | |
constructor(name, age) { | |
super(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* class, constructor, object */ | |
class Student { | |
constructor(name, id) { | |
this.name = name; | |
this.id = id; | |
this.university = "Harvard University"; | |
} | |
} | |
const student1 = new Student("Tom Hardy", 101); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Arrow functions - implicit return*/ | |
const doubleIt = (num) => num * 2; | |
console.log(doubleIt(4)); | |
// Output: 8 | |
const add = (a, b) => a + b; | |
console.log(add(40, 50)); | |
// Output: 90 | |
/* explicit return */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Default Parameter */ | |
function addFifty(num1, num2 = 50) { | |
return num1 + num2; | |
} | |
const result = addFifty(10, 20); | |
const result2 = addFifty(20); | |
console.log(result, result2); | |
// Output : 30 70 | |
/* Template string */ |