Skip to content

Instantly share code, notes, and snippets.

@iamshareque
Last active August 26, 2021 07:07
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 iamshareque/d66ee78894886b1bd3dd87e0de629d5e to your computer and use it in GitHub Desktop.
Save iamshareque/d66ee78894886b1bd3dd87e0de629d5e to your computer and use it in GitHub Desktop.
1) Avoid using let for variable declaration use var
let x=10; or const x=10;
var x=10; (compatibale)
2) Avoid using default value for funcation parameter
function add(a,b=20){
}
//instead use this way
funcation add(a,b){
var b;
if (typeof b === "undefined") { b = 20; }
}
3) Avoid using arrow funcation
hello = () => {
return "Hello World!";
}
4) Avoid javacript template string like (don't use ``)
`this is template string ${xvriable} eclosed in backquote `
5) this will help to convert ES6 to ES5 https://babeljs.io/repl
6) old iphone when using div with onclick=""
must add css: cursor: pointer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment