javascript Programming Glossary: memo
How to sort a collection of objects in JavaScript without converting it to an array http://stackoverflow.com/questions/10623463/how-to-sort-a-collection-of-objects-in-javascript-without-converting-it-to-an-ar and Underscore's pluck to unwrap the Schwartzian Transform memo wrappers pluck returns an array so sortBy also returns an array...
Find the longest common starting substring in a set of strings http://stackoverflow.com/questions/1916218/find-the-longest-common-starting-substring-in-a-set-of-strings slightly tweaked function common_substring data var i ch memo idx 0 do memo null for i 0 i data.length i ch data i .charAt.. function common_substring data var i ch memo idx 0 do memo null for i 0 i data.length i ch data i .charAt idx if ch break.. i 0 i data.length i ch data i .charAt idx if ch break if memo memo ch else if ch memo break while i data.length idx data.length..
Apparently contradictory behavior of Javascript function http://stackoverflow.com/questions/7377853/apparently-contradictory-behavior-of-javascript-function The Good Parts. works great. var fibonacci function var memo 0 1 var fib function c console.debug memo c memo c result memo.. function var memo 0 1 var fib function c console.debug memo c memo c result memo c if typeof result 'number' result fib.. var memo 0 1 var fib function c console.debug memo c memo c result memo c if typeof result 'number' result fib c 1 fib..
Javascript Memoization Explanation? http://stackoverflow.com/questions/8548802/javascript-memoization-explanation doesn't declare any parameters var fibonacci function var memo 0 1 var fib function n var result memo n if typeof result 'number'.. function var memo 0 1 var fib function n var result memo n if typeof result 'number' result fib n 1 fib n 2 memo n result.. memo n if typeof result 'number' result fib n 1 fib n 2 memo n result return result return fib for var i 0 i 10 i 1 document.writeln..
|