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
// find all combination of coins up to an amount of money. | |
function findCoinCombination(money, coins) { | |
var solution = Arrays.from(coins, function() { | |
return 0; | |
}) | |
function helper(moneyLeft, level, solution) { | |
if (level == solution.length - 1) { | |
solution[level] = moneyLeft; | |
console.log(solution) | |
return; |
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
// iife | |
(function(moduleArray) { | |
var cache = {}; | |
function webpackRequire(index) { | |
if (cache[index]) { | |
return cache[index]; | |
} | |
var module = { exports: {} }; | |
var file = moduleArray[index]; |
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 debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { | |
timeout = null; | |
if (!immediate) { | |
func.apply(context, args) | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>A Type Ahead Example</title> | |
</head> | |
<body> | |
<!-- The Trick here is to use two overlapping <input>, one for the hint, one for the actual input --> | |
<div style="position: relative;"> | |
<input |