Skip to content

Instantly share code, notes, and snippets.

@wpweb101
Last active April 16, 2021 07:31
Show Gist options
  • Save wpweb101/c423172db1dbbc368df1c19e82bf3bad to your computer and use it in GitHub Desktop.
Save wpweb101/c423172db1dbbc368df1c19e82bf3bad to your computer and use it in GitHub Desktop.
JavaScript Best Practices
var example = 0;
var result = total / input;
function myFunc() {
// Output the string to the browser console
console.log('This is console string');
if ( result ) {
alert('Woo hoo!');
}
switch(expr) {
case 'String1':
alert('String1');
break;
case 'String2':
alert('String2');
break;
default:
alert('Not matched with ' + expr + '.');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment