Skip to content

Instantly share code, notes, and snippets.

/**
* 回形矩阵
* @param {Number} n - 矩阵尺寸
* @return {String}
*/
function spiralMatrix (n) {
let matrix = [];
let a = n ** 2;
let p = a.toString().length;
for (let x = 0; x < n; x++) {
/**
* Promises/A+
* @see http://www.ituring.com.cn/article/66566
* @param {Function} executor
*/
function MyPromise (executor) {
let PromiseStatus = "pending";
let PromiseValue = undefined;
let PromiseTasks = [];