4 ways to defind data types of JavaScript
There are 4 ways to defind data types of JavaScript: 1. typeof, 2. instance of, 3. Object.prototype.toString.call(), 4. constructor. hope this helps.
JavaScript data typesJavaScript has 8 built-in types, expecting object, they are all called “basic type”. Which are:
nullundefinedbooleannumberstringobjectsymbolbigInt
1. typeoftypeof is not a function but a operator, it returns a string indicating the type of the unevaluated operand, includes number, boolean, symbol, string, object, undefined, ...
Different of map() and forEach() (Part.1)
Most famous methods of JavaScript map and forEach, they are existing since ECMAScript 5 (es5).
In this artical, I will put out the major different between JavaScript methods map() and forEach() by some useful examples.
What is map() and forEach()map() and forEach() are included in Array.prototype.
We used to looping through an array like this:
1234567let array = ['1', '2', '3']for (var i = 0; i < array.length; i += 1) { console.log(Number(array[i]));}//1//2//3
for() loop is t ...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment