[js] 迷惑
#
var a = { n: 1 } var b = a; a.x = a = { n: 2 } console.log(a.x);//undefined console.log(b.x)//Object {n: 2}
#
var foo = "11" + 2 - "1"; console.log(foo);//111 console.log(typeof foo);//number
#
var foo = "11" + 2 + "1"; console.log(foo);//'1121' console.log(typeof foo);//string
#property?
var regexp = /:(\w+)/g; var str = ':method :url'.replace(regexp, function(match, property) { console.log(match); console.log(property); });
浙公网安备 33010602011771号