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
var rectangle = { | |
_h: 1, | |
_w: 1, | |
_area: 1 | |
}; | |
Object.defineProperties(rectangle,{ | |
h: { | |
get: function(){ | |
return this._h; |
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 specialString(){ | |
var values = new String(arguments[0]); | |
values.startWith= function(text){ | |
if(values.indexOf(text) == 0){ | |
return true; | |
}else{ | |
console.log(values,values.indexOf(text)); | |
return false; | |
} |
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
/** | |
* 执行语句: node --trace_opt --trace_deopt --allow-natives-syntax test.js | |
*/ | |
// 包含需要审查的用法的函数 (这里是 with 语句) | |
function containsHeight() { | |
return 3; | |
// with({}) { } // with 注释掉之后,又可以优化了 | |
} |
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
/* 后端数据 */ | |
var data = { | |
"10;20;30": { | |
price: 5, | |
count: 1 | |
}, | |
"10;20;31": { | |
price: 10, | |
count: 2 | |
}, |
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
// https://github.com/MostlyAdequate/mostly-adequate-guide | |
// https://llh911001.gitbooks.io/mostly-adequate-guide-chinese/content/ch5.html | |
// this is my practice while reading the book | |
var compose = function(){ | |
var args = arguments; | |
return function(x){ | |
var res = x; |
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
name: 锁定 | |
description: lock a range | |
author: kreja | |
host: EXCEL | |
api_set: {} | |
script: | |
content: | | |
$("#setup").click(setup); | |
async function setup() { | |
await Excel.run(async (context) => { |
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
name: delete table rows doesn’t trigger onChanged | |
description: delete table rows doesn’t trigger onChanged | |
author: kreja | |
host: EXCEL | |
api_set: {} | |
script: | |
content: | | |
$("#create-table").click(createTable); | |
async function createTable() { |
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
name: Values and formulas | |
description: Gets and sets values and formulas for a range. | |
author: kreja | |
host: EXCEL | |
api_set: {} | |
script: | |
content: | | |
$("#setup").click(() => tryCatch(setup)); | |
async function setup() { |