YonKee Blog

Thinking will not overcome fear but action will.

Set Object Default Values.

Set Object Default Values setDefaultValues function setDefaultValues(obj, defaultObj) { for (let [key, value] of Object.entries(defaultObj)) { if (obj[key] === null || obj[key] === undefine...

ESM and CommonJS.

ESM and CommonJS CJS CJS is short for CommonJS. Here is what it looks like: //importing const doSomething = require('./doSomething.js'); //exporting module.exports = function doSomething(n) { // ...

Typescript Generic Function

Typescript Generic Function function makePair< F extends number | string, S extends boolean | F >() Generic function only able to pass number, string function makeState<S extends n...

高项计算

layout: post title: 高项计算 subtitle: date: 2020-10-30 author: fsanren header-img: img/lyx-h-01.jpg catalog: true tags: - 软考 — 高项计算 线性规划求最值 给定类似: ​ x + ...

DNS cheatsheet

What is DNS 1. To get to www.example.com, your computer needs to know where on the Internet that server is That means: it has to know what IP address to talk to The way it finds out is the Domai...

Fragment Shader

What is GLSL GLSL stands for openGL Shading Language, which is the specific standard of shader programs #ifdef GL_ES precision mediump float; #endif uniform vec2 u_resolution; uniform vec2 u_mou...

Regular Expression Shortcuts

Create A regular expression is a type of object. It can be either constructed with the RegExp constructor or written as a literal value by enclosing a pattern in forward slash (/) characters. ...

Cannot find module lodash.deepclone

When you install node-sass by npm install,node-sass required lodash.deepclone. npm will install the lodash.deepclone automatic. However, node-sass usually install failed blame to network or GFW. ...

GitHub Page Sample

GitHub Page Sample Every GitHub Account has 300M space for free and you can build your own website using Custom domain Basic Steps Creat a repository named username.github.io Push an static...

JS竖杠、双竖杠

JS单竖杠的作用 这里介绍|的作用 console.log(0.6|0)//0 console.log(1.1|0)//1 console.log(3.65555|0)//3 console.log(5.99999|0)//5 console.log(-7.777|0)//-7 看了上面的例子,大体知道单竖杠可以进行取整运算,就是只保留正数部分,小数部分通过拿掉,但是|0,又是如何进...