完全理解icmp協議
阿新 • • 發佈:2021-11-12
<!DOCTYPE html>
<html lang="Zh-cn">
<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>Document</title>
<script>
//typeof instanceof
var arr=[1,2,3,4,5];
//console.log(typeof arr);//object
//console.log(typeof {});//object
// console.log(arr instanceof Array);//true
// console.log({} instanceof Object);//true
// console.log(arr instanceof Object);//true
//call apply bind
// console.log(Object.prototype.toLocaleString.call(arr))
//.log(Object.prototype.toLocaleString.bind(arr))//返回的是函式的拷貝 如果要呼叫需加()
//console.log(Object.prototype.toLocaleString.bind(arr)())
//高階函式 // function f(){ // console.log("f()") // }
//f() // function f(){ // return function(){ // console.log("f()") // } // } // f()() // console.log("f()")
// function f(fun,fun2){ // btn.click=function(){ // fun() // fun2() // } // } // function sum(){ // console.log("sum") // } // sum(); // f(sum)
//回撥地獄 // function f(fun){ // fun(); // } // f(f(f(f()))) //Promise then
//new Promise().then().then().then()解決回撥地獄問題 </script> </head> <body> </body> </html>
//高階函式 // function f(){ // console.log("f()") // }
//f() // function f(){ // return function(){ // console.log("f()") // } // } // f()() // console.log("f()")
// function f(fun,fun2){ // btn.click=function(){ // fun() // fun2() // } // } // function sum(){ // console.log("sum") // } // sum(); // f(sum)
//回撥地獄 // function f(fun){ // fun(); // } // f(f(f(f()))) //Promise then
//new Promise().then().then().then()解決回撥地獄問題 </script> </head> <body> </body> </html>