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
import VerEx from 'verbal-expressions'; | |
const eventualCallIs = name => { | |
// FOR PERF | |
const boundCheck = node => | |
node.type === 'Identifier' && node.name === name || | |
node.type === 'MemberExpression' && boundCheck(node.object) || | |
node.type === 'CallExpression' && boundCheck(node.callee) | |
return boundCheck; |
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 bubbleSort = function(array) { | |
for (var i=0, length=array.length; i<length; i+=1) { | |
for (var j=0; j<array.length-i-1; j+=1) { | |
if (array[j]>array[j+1]) { | |
var smallNum = array[j+1]; | |
array[j+1]=array[j]; | |
array[j]=smallNum; | |
} | |
} | |
} |