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
var abul = 100; | |
var babul = 99; | |
console.log("Before swap abul = ", abul, "babul = ", babul); | |
var temp = abul; //The temp value is now abul's value 100. | |
abul = babul // now abul has babul's value 99. | |
babul = temp //because temp has babul's value 100. | |
console.log("After swap abul = ", abul, "babul = ",babul); |
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 test () { | |
const a = 5; | |
const b = 5; | |
return a + b; | |
} |
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 test (a, b) { | |
return a + b; | |
} |
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 test (a, b = 1) { | |
return a + b; | |
} |
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 from 'react'; | |
// Correct! This is a component and should be capitalized: | |
function Hello(props) { | |
// Correct! This use of <div> is legitimate because div is a valid HTML tag: | |
return <div>Hello {props.toWhat}</div>; | |
} | |
function HelloWorld() { | |
// Correct! React knows <Hello /> is a component because it's capitalized. |