fengchuanyu 4 months ago
parent
commit
6d917f0880
1 changed files with 37 additions and 1 deletions
  1. 37 1
      6_ES6/17_原型.html

+ 37 - 1
6_ES6/17_原型.html

@@ -1 +1,37 @@
-html
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <script>
+        // function foo(){
+        //     console.log(this);
+        // }
+        // foo.loveCoding()
+
+        //String Array Number Function Object Boolean
+        
+        // 原型
+        // console.log(Array.prototype);
+        // console.log(String.prototype);
+
+        // var arr = [1,2,3];
+        // var arr2 = new Array(1,2,3);//构造函数
+
+
+        Function.prototype.loveCoding = function(){
+            console.log("loveCoding");
+            console.log(this);
+        }
+
+        function foo(){
+            console.log(this);
+        }
+
+        foo.loveCoding();
+    </script>
+</body>
+</html>