30秒学会 JavaScript 片段 – Calculate SHA-256 hash in JavaScript
The SHA-256 algorithm is a widely used hash function producing a 256-bit hash value. It is used in m...
The SHA-256 algorithm is a widely used hash function producing a 256-bit hash value. It is used in m...
Writes a JSON object to a file. Use fs.writeFileSync(), template literals and JSON.stringify() to wr...
Combines two arrays of objects, using the specified key to match objects. Use Array.prototype.reduce...
Boolean logic and logical operations might not come up that often in JavaScript development, but whe...
A very common need when building websites is the ability to copy text to clipboard with a single but...
Converts an array of objects into an array of values corresponding to the specified key. Use Array.p...
The destructuring assignment syntax, first introduced in JavaScript ES6, allows the unpacking of val...
作用:检查给定的参数是否是 stream。 实现思路:首先检查是否是 null,如果不是的话再使用 typeof 检查是否中 object,并且其属性 pipe 是否是 function 类型。
绑定对象的函数里的 this 到对象本身。 使用 Array.prototype.forEach() 来遍历对象里所有指定的函数,使用 Function.prototype.apply() 来指定函数...