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
let myclass = new myClass() | |
.setvalue(2) | |
.setString('abc') | |
.setPrice(500) | |
.displayCart(); |
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 a; | |
var b; | |
var c; | |
// Good Example | |
var examplestring = 'this is example ' + a + | |
'string that spans into' + B + | |
'three lines' + c; | |
// Bad example |
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
switch ( n ) { | |
case n1: | |
case n2: | |
x(); | |
break; | |
case n3: | |
y(); | |
break; | |
default: | |
z(); |
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( $ ) { // Expression indented | |
// This doesn't get indented | |
function do_something() { | |
// Your logic | |
} | |
} )( jQuery ); |
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 example; | |
if ( condition 1 ) { // use space before and after parenthesis | |
// write you code here // follow tabbing | |
} else if( condition 2 ) { | |
// write you code here | |
} else { | |
// write you code here | |
} |
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
#example { | |
font-family: Helvetika Neue, sans-serif; /* Quote font name*/ | |
font-size:15px; /* Maintain space before property value */ | |
padding:10px /* Missing semicolon*/ | |
} |
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
#example { | |
font-family: "Helvetika Neue", sans-serif; /* Using double quotes */ | |
font-size: 15px; /* End with semicolon*/ | |
margin: 0 0 0 10px; /* Right use of 0 values*/ | |
} |
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
/* This is a single-line comment */ | |
p { | |
color: red; | |
} | |
p { | |
color: red; /* Example for inline comment */ | |
} | |
/* This is |
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
a { | |
-webkit-transition: -webkit-transform 1s; | |
transition: -ms-transform 1s; | |
transition: transform 1s | |
} |
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
.container { | |
color: #fff; | |
position: relative; | |
font-size: 12px; | |
display: block; | |
padding: 5px; | |
} |