JavaScript - String of data type

A data type is a literal type There are eight basic data types in JavaScript (the first seven are basic data types, also known as primitive types, while object is a complex data type). Number is used for any type of number: integer or floating-point number, an integer in the range of ± (253-1).bigint is used for integers of any length. ...

Posted by bobocheez on Tue, 25 Jan 2022 11:54:38 +0100

Mock is both a shield and a weapon

Front end mock Now the development modes are generally front-end and back-end separated, so it is necessary to "accommodate" each other. For example, the background only defines the interface document in general, the interface has not yet come out, the front-end can not wait foolishly, but there is no coordination to develop, many de ...

Posted by MisterWebz on Mon, 24 Jan 2022 14:56:48 +0100

"This is a page bookmark. When I come back, I remember to roll back to the original."

Page Bookmarks Simply put, you scroll through the current page, and when you come back from a trip out, you restore the scrolling position, just like a bookmark in a book. Then describe your expectations for page bookmarks When I jump to another page, I come back to recover.Recovery cannot be positioned too obtrusively directly. It should be ...

Posted by warren on Mon, 24 Jan 2022 08:47:58 +0100

The difference between var, let and const

ES6: the difference between VaR, let and const 1, var In ES5, the attributes of top-level objects are equivalent to global variables. Variables declared with var are both global variables and top-level variables Note: top level objects refer to window objects in browser environment and global objects in Node environment var a = 10; consol ...

Posted by esfisher on Sun, 23 Jan 2022 20:54:43 +0100

ES6 object new extension

ES6: object new extension 1, Attribute abbreviation In ES6, when the object key name is equal to the corresponding value name, it can be abbreviated const baz = {foo:foo} // Equivalent to const baz = {foo} Methods can also be abbreviated const o = { method() { return "Hello!"; } }; // Equivalent to const o = { method: funct ...

Posted by karimali831 on Sun, 23 Jan 2022 17:38:12 +0100

Process abstraction of writing JS principles

Process abstraction Process abstraction Used to handle local detail controlProcess abstraction is the basis of function thought In the process of imagination abstraction, it can be abstracted into a room, the door and window in the room, and then the room space itself is data, but the action and behavior of opening the door or window ...

Posted by dror_israel on Sun, 23 Jan 2022 08:16:46 +0100

Common methods of JS array

[will change the original array] 1. Array.push(), adds one or more elements to the end of the array and returns the new array length. Original array change let arr = [1,2,3,4] arr.push(5,6,7) console.log(arr) // [1, 2, 3, 4, 5, 6, 7] 2. Array.pop(), delete and return the last element of the array, if the array is empty Ze returns undefind. ...

Posted by powerspike on Sun, 23 Jan 2022 02:03:56 +0100

JavaScript key and difficult point parsing 5 (advanced object, browser kernel and event loop model (js asynchronous mechanism))

Object advanced Object creation mode Object constructor mode First create an empty Object object, and then dynamically add properties / methods var p = new Object() p = {} p.name = 'Tom' p.age = 12 p.setName = function (name) { this.name = name } console.log(p.name, p.age) p.setName('Bob') console.log(p.name, p.ag ...

Posted by goodluck4287 on Sat, 22 Jan 2022 23:40:36 +0100

[ES5] overview of new methods - foreach () - filter () - some () - map () - trim () - object defineProperty()

ES5 has added some methods to operate arrays or strings conveniently. These methods mainly include: Array methodString methodObject method 1, Array method Iterative (traversal) methods: forEach, map(), filter(), every() 1.forEach Executes the given function once for each element of the array. 1.1 writing method array.forEach( func ...

Posted by thefisherman on Sat, 22 Jan 2022 14:41:01 +0100

Record a nodejs development and use webpack to package and publish the project

Premise: nodejs environment 1. Initialize project npm init After the initial project, there will be one more package. In the project directory JSON file, and then the configuration is related to this file My file directory structure is as follows: The. babelrc configuration file will be described later 2. Download and configure webpack ...

Posted by frigidman on Sat, 22 Jan 2022 14:14:47 +0100