js array, object learning and other knowledge
Learning about array, object method, and array equality judgment
Array method
forEach()
The forEach() method executes the given function once for each element of the array.
const array1 = ['a', 'b', 'c'];
array1.forEach(element => console.log(element));
// "a"
// "b"
// "c"
Use arr.forEach(callback(currentValue [, index [, array]])[, ...
Posted by sfhc on Sun, 05 Sep 2021 09:08:24 -0700
Notes--Advanced javascript functions
1. Definition and invocation of functions
How 1.1 functions are defined
1. Function Declarations function Keyword (named function)
2. Function expression (anonymous function)
3. new Function()
var fn=new Function('Parameter 1', 'Parameter 2', 'Parameter 3'..., 'Function Body')
- Function Inside parameters must be in string format
- The third ...
Posted by SilverFoxDesign on Sun, 05 Sep 2021 09:07:02 -0700
On prototype and prototype chain
Understanding prototypes and prototype chains
This article will use concepts + exercises to help understand
concept
Before we understand the prototype, let's talk about constructors and using constructors to create objects
Constructor and create instance
for instance:
An ordinary Person function is defined, which is still an ordinary func ...
Posted by macman90 on Fri, 03 Sep 2021 19:02:52 -0700
Front end interview self-test knowledge points --- object and object related knowledge points, handwritten deep copy
object
Concise expression of attributes
let name = "Lucy"
let age = 16
let s = "school"
let obj = {
name,
age,
s:"PKU"
}
console.log(obj) // Output {name: "Lucy", age: 16, s: "PKU"}
Property name expression
let name = "Lucy"
let age = 16
let s = "school"
let obj = {
name,
age,
[s]:"PKU"
}
console.log(o ...
Posted by sureshp on Fri, 03 Sep 2021 15:59:02 -0700
Vue learning notes - webpack
Webpack is a front-end resource modular management and packaging tool. The webpack.config configuration file contains entry files, exit files, loader loader and plugin plug-ins
Package directly through the webpack command on the console
The followin ...
Posted by nickk on Thu, 02 Sep 2021 21:35:36 -0700
javaScript learning notes ES6
1, Remaining parameters
1. Understanding residual parameters
The remaining parameters are always arrays, even if there are no values, they are empty arrays
// grammar
const add = (x, y, ...args) => {
console.log(x, y, args) // w 4 [5,45]
}
add('w', 4, 5, 45)
2. Remaining parameter considerations ...
Posted by freddykhalid on Thu, 02 Sep 2021 19:10:42 -0700
JavaScript (data type conversion and operator)
1. Data type and type conversion
(1) Data type and typeof()
The following basic data types are provided in JavaScript
String string
Number value
Boolean Boolean type
null empty
undefined Undefined
typeof (dat) can get the data type of the specified data
(2) Type conversion
1. Convert to numeric typ ...
Posted by RSprinkel on Wed, 01 Sep 2021 17:25:46 -0700
Core concepts of React
Core concept of React (2)
1. Component introduction and props
1.1 component classification
Component, conceptually similar to JavaScript functions. It accepts any input parameter (i.e. "props") and returns the React element used to describe the content of the page presentation( Quoted from: Components & props )
Compo ...
Posted by Zepo. on Wed, 01 Sep 2021 16:13:44 -0700
Set collection type
ECMAScript 6 adds a Set set type to bring a Set data structure to the language. Sets are like enhanced maps in many ways because most of their API s and behaviors are common.
6.6.1 basic API
You can create an empty collection using the new keyword and the Set constructor. If you want to initialize the instance while creating, you can pass an ...
Posted by Garrett on Wed, 01 Sep 2021 13:06:42 -0700
Prototype Chain and Inheritance
Catalog
Prototype Chain
inherit
Why does Javascript not have a method signature?
Prototype Chain Inheritance
Constructor Inheritance
Combinatorial Inheritance
Prototype Inheritance
Parasitic Inheritance
Parasitic combinatorial inheritance
Prototype Chain
A prototype chain is a relationship between a prototype object and an instanc ...
Posted by dswain on Wed, 01 Sep 2021 09:23:09 -0700