1、
if (x === undefined) { ... }
不严谨,undefined 关键字是可以被更改的。
2、
const toUnicode = (str) => str.split('').map((char) => { | |
const temp = char.charCodeAt(0).toString(16).toUpperCase(); | |
if (temp.length > 2) { | |
return '\\u' + temp; | |
} | |
return char; | |
}).join(''); | |
console.log(toUnicode('转换成 Unicode')); |
/** | |
* 时间格式化 | |
* 今天的,显示“今天 08:08” | |
* 昨天、前天 | |
* 3天前,显示具体日期 | |
* @param {Number} _time UNIX时间戳 | |
*/ | |
_p._$timeFormat = (function () { | |
// 一天的毫秒数 | |
var _oneDay = 24 * 60 * 60 * 1000; |
1、
if (x === undefined) { ... }
不严谨,undefined 关键字是可以被更改的。
2、
set: function (key, val, options) {
// ...
// You might be wondering why there's a `while` loop here. Changes can
// be recursively nested within `"change"` events.
if (changing) return this;
if (!silent) {
while (this._pending) {
this._pending = false;
#!/usr/bin/env node | |
/* | |
PO parser from http://jsgettext.berlios.de/lib/Gettext.js | |
adapted for Node.js and modified to be more like po2json.pl | |
- Zach Carter <[email protected]> | |
*/ | |
/* | |
Pure Javascript implementation of Uniforum message translation. |
# 查看Linux的发行版本 | |
lsb_release -a | |
uname -a | |
cat /etc/issue | |
cat /proc/version | |
# 列出本地已经安装了的 package | |
dpkg --get-selections | grep -v deinstall | |
groups # 查看本机所有的组 |
library(tidyverse) | |
library(gganimate) | |
NUMPLAYERS = 45 | |
ROUNDS = 5000 | |
INITWEALTH = 45 | |
#initialize the bank | |
#columns wealths of the NUMPLAYERS players | |
#rows show wealths of each of the ROUNDS ticks of the clocks |