Skip to content

Instantly share code, notes, and snippets.

@sanzeeb3
Created December 27, 2018 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanzeeb3/a209ff93d61b60123763b671ab305755 to your computer and use it in GitHub Desktop.
Save sanzeeb3/a209ff93d61b60123763b671ab305755 to your computer and use it in GitHub Desktop.
Self Learning REACT JS
let a = 30;
console.log(a);
if( true ) {
let b = 40;
}
console.log(b); // Undefined.
const a = 45;
a = 30; // Error.
let WorkingFunction = (a = 10, b) => {
return a+b;
}
WorkingFunction( 20, 30 ); // Returns 50;
let NotWorkingFunction = ( a= 10, b ) => {
return a + b;
}
NotWorkingFunction( 20 ); // NAN, Since b is undefined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment