This file contains hidden or 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 _ = require("lodash"); | |
var performRoles = require("./performRoles.js"); | |
performRoles({ foo: 1 }); |
This file contains hidden or 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
Array.prototype.squeeze = function (n, fn) { | |
const from = Object(this).slice(); | |
const to = []; | |
while (n > 0 && from.length) | |
to.push(fn.apply(undefined, from.splice(0, n))); | |
return to; | |
} |
This file contains hidden or 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
// JavaScript signed zero example. | |
// Note that +0 equals -0 in JavaScript. | |
var getPlusZero = () => +0; | |
var getNegativeZero = () => -0; | |
var isPlusZero = x => Math.atan2(0, x) === 0; | |
var isNegativeZero = x => Math.atan2(0, x) !== 0; | |
console.log(isPlusZero(getPlusZero())); | |
console.log(isPlusZero(getNegativeZero())); |
NewerOlder