renjm.com
GeraldChen's Blog
http://www.renjm.com/blog/tag/underScore
Var stooges = [{name: 'moe'. Max( pluck(stooges, "age". May 15, 2015. 转: We have a problem with promises.
renjm.com
GeraldChen's Blog
http://www.renjm.com/blog/tag/codewars
M, 900 = CM, 90 = XC, 4 = IV. Function solution (roman) {. Var res= { I:. Reduce(function(p, v, i, arr) {. P -= res[v] : p = res[v]. 好吧 还有更简单的解法, 因为罗马数字总数从大到小写的. 1000, CM: 900, D. 400, C: 100, XC: 90, L. XL: 40, X: 10, IX: 9, V: 5, IV: 4, I: 1};. Function solution (s) {. 0, ilength) = i) {. S = s substr. V = res[i];. Function toRoman (v) {. V = res[i]) {. V -= res[i];. March 26, 2015. 好吧,function也是一个对象,在做比较时转换成原始值会调用valueOf(), 参考 这篇. March 18, 2015. October 10, 2014. Pconcat( p.map ( function.
renjm.com
转: We have a problem with promises | GeraldChen's Blog
http://www.renjm.com/blog/We-have-a-problem-with-promises
转: We have a problem with promises. July 7, 2015. 转: We have a problem with promises.
renjm.com
js 理解函数声明提升与变量声明提升 | GeraldChen's Blog
http://www.renjm.com/blog/js理解函数声明提升与变量声明提升
Alert(a); / 1. June 2, 2015. 转: We have a problem with promises.
renjm.com
function arguments参数 | GeraldChen's Blog
http://www.renjm.com/blog/function-arguments参数
March 31, 2015. 转: We have a problem with promises.
renjm.com
GeraldChen's Blog
http://www.renjm.com/blog/tag/algorithm
假设有物品列表var items = [ 2, 5],[3, 1],[5, 4],[6, 10] ; items[x][0]为物品重量,items[x][1]为价值. Res = [],. I items.length; i ) {. J = capacity; j ) {. Length = items.length; i length; i ) {. J = capacity; j = 0. Res[i][j] = res[i - 1. To = res[i - 1. J - items[i][ 0. Max(res[i][j], to);. J = capacity;. I = items.length - 1. X[i] = x[i] 0. Res[i][j] res[i - 1. J = j - items[i][ 0. Items); / 15 x: [1, 0, 0, 1]. Res = [];. I = capacity; i ) res[i] = 0. Length = items.length; i length; i ) {. J = capacity; j items[i][ 0.
renjm.com
js 具名函数及匿名函数 | GeraldChen's Blog
http://www.renjm.com/blog/js-具名函数及匿名函数
Log(A); / [Function A]. A); / undefined. Log(A); / [Function A]. Log(A); / [Function A]. Log(A); / 1. 原理解释: http:/ segmentfault.com/q/1010000002810093. 转: We have a problem with promises. July 28, 2015. 转: We have a problem with promises.
renjm.com
GeraldChen's Blog
http://www.renjm.com/blog/tag/js
Let { x, y, .z } = { x:. Let state = { a:. Console.log({ .state, b:. A: 1, b: 2}. Console.log(state) / {a: 1, b: 1}. Object.assign({}, state, { b:. April 6, 2016. December 16, 2015. Foo( o1 );. Log( o1.a ); / 2. Foo( o2 );. Log( o2.a ); / undefined. Log( a ); / 2 a被泄漏到全局作用域上了. August 24, 2015. Log(A); / [Function A]. A); / undefined. Log(A); / [Function A]. Log(A); / [Function A]. Log(A); / 1. 原理解释: http:/ segmentfault.com/q/1010000002810093. July 28, 2015. 转: We have a problem with promises. July 7, 2015.
renjm.com
背包问题 (一) | GeraldChen's Blog
http://www.renjm.com/blog/背包问题(一)
假设有物品列表var items = [ 2, 5],[3, 1],[5, 4],[6, 10] ; items[x][0]为物品重量,items[x][1]为价值. Res = [],. I items.length; i ) {. J = capacity; j ) {. Length = items.length; i length; i ) {. J = capacity; j = 0. Res[i][j] = res[i - 1. To = res[i - 1. J - items[i][ 0. Max(res[i][j], to);. J = capacity;. I = items.length - 1. X[i] = x[i] 0. Res[i][j] res[i - 1. J = j - items[i][ 0. Items); / 15 x: [1, 0, 0, 1]. Res = [];. I = capacity; i ) res[i] = 0. Length = items.length; i length; i ) {. J = capacity; j items[i][ 0.
renjm.com
GeraldChen's Blog
http://www.renjm.com/blog/tag/jQuery
Prototype.forEach = function. This is null or not defined'. Len = O.length 0. Callback ' is not a function'. T = thisArg;. KValue = O[k];. Callback.call(T, kValue, k, O); / 主要就是这段代码. JQuery.each = function( object. Name, i = 0. IsObj = length = = undefined jQuery.isFunction( object. Name ], args ) = = false. I length; ) {. I ], args ) = = false. A special, fast, case for the most common use of each. Name ], name, object. Name ] ) = = false. I length; ) {. I ], i, object. I ] ) = = false. April 13, 2015.
SOCIAL ENGAGEMENT