- sources: MDN, google/airbnb style guides
/// a one line comment
/* a mutli-
var Year = function(input) { | |
this.input = input; | |
}; | |
Year.prototype.isLeap = function() { | |
if (this.input % 4 === 0) { | |
if (this.input % 100 === 0) { | |
if (this.input % 400 === 0) { | |
return true; |
var Year = require('./leap'); | |
describe('Leap year', function() { | |
it('is not very common', function() { | |
var year = new Year(2015); | |
expect(year.isLeap()).toBe(false); | |
}); | |
it('is introduced every 4 years to adjust about a day', function() { |
var Year = function(input) { | |
Year.prototype.isLeap = function() { | |
if (input % 4 === 0) { | |
if (input % 100 === 0) { | |
if (input % 400 === 0) { | |
return true; | |
} else { | |
return false; |
position: absolute;
Use a consistent, simple, clean design to reduce cognitive load and make your site easily navigable and easy to use
function List() { | |
this.head = null; | |
this.tail = null; | |
this._length = 0; | |
}; | |
List.prototype.push = function(data) { | |
var newNode = new ListNode(data); | |
if (this.head === null && this.tail === null) { | |
this.head = newNode; |
request | |
.get(url) | |
.pipe(fs.createWriteStream(path)) | |
.on('close', callback) |
let stream = progress({ time: 50 }) | |
stream.on('progress', progress => { | |
mainWindow.setProgressBar(progress.percentage / 100.0) | |
}) | |
request | |
.get(url) | |
.pipe(stream) | |
.pipe(fs.createWriteStream(path)) |