Skip to content

Instantly share code, notes, and snippets.

View ylc395's full-sized avatar
😎

叡山电车 ylc395

😎
View GitHub Profile
@ylc395
ylc395 / cloudSettings
Last active May 29, 2020 10:33
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-29T10:33:53.525Z","extensionVersion":"v3.4.3"}
@ylc395
ylc395 / calc.js
Last active April 14, 2017 12:04
一个解析四则运算表达式的函数
(function(expression) {
let operators = {
'+' : (a, b) => a + b,
'-': (a, b) => a - b,
'*': (a, b) => a * b,
'/': (a, b) => {
if(b === 0) throw Error('除数不能为0');
return a / b;
}
};