-
Iteration methods:會每一個element都給他see一次,every()、filter()、forEach()、map()、some()
-
Accessor methods:不會更動陣列本身,只是呈現你想呈現的,lastIndexOf()、indexOf()
-
Mutator methods:push() pop() unshift() shift()
This file contains hidden or 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
var alpha = 'dajvgiasdrrrrkq;wrklrq'; | |
var Letters = new Map(); | |
// has set get methods | |
alpha.split('').map(letter => { | |
if (!Letters.has(letter)) Letters.set(letter, 1); | |
else Letters.set(letter, Letters.get(letter) + 1); | |
}); | |
// keys() values() and entries() contain both. |
This file contains hidden or 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
import socket | |
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
host = socket.gethostbyname('') | |
port = 5001 | |
serversocket.bind((host, port)) | |
serversocket.listen() | |
while True: |
This file contains hidden or 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
const obj = { | |
a: 32, | |
b: 32, | |
c: "Hello", | |
d: 128, | |
}; | |
let total = 0; | |
Object.prototype.parentPro = 300; | |
function iterateToSum(obj) { |
This file contains hidden or 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
# variables | |
NEXT = npx next | |
GIT = git | |
# defalt | |
.PHONY: all | |
all: | |
@echo "Available targets:" | |
@echo " make out - Prepare for publishing, a.k.a next build" | |
@echo " make commit \"Your commit message\" - Commit changes" |
OlderNewer