-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from xingorg1/develop
Develop
- Loading branch information
Showing
19 changed files
with
6,188 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
let array1 = [1] | ||
console.log(array1.concat(2)); // [ 1, 2 ] | ||
console.log(array1.concat(3,4, [5])); // [ 1, 3, 4, 5 ] | ||
console.log(array1.concat([6, 7])); // [ 1, 6, 7 ] | ||
console.log(array1.concat([8], [9, 10])); // [ 1, 8, 9, 10 ] | ||
|
||
console.log(array1.concat(2).concat(3,4,[5]).concat([6, 7]).concat([8], [9, 10])) // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>6.2.7 转换方法-valueOf</title> | ||
</head> | ||
<body> | ||
<script> | ||
Array.prototype.valueOf = function () { | ||
return this.map((item) => { | ||
return item + '石头姐' | ||
}) | ||
} | ||
let array1 = [1, 2] | ||
console.log(array1.valueOf()) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
let array1 = [1, 2] | ||
console.log(array1.valueOf()) // [1, 2] | ||
Array.prototype.valueOf = function () { | ||
return this.map((item) => { | ||
return item + '石头姐' | ||
}) | ||
} | ||
console.log(array1.valueOf()) // [ '1石头姐', '2石头姐' ] | ||
|
Oops, something went wrong.