fengchuanyu 7 jam lalu
induk
melakukan
91ca40d322

+ 47 - 0
.gitignore

@@ -0,0 +1,47 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+**/node_modules
+# roadhog-api-doc ignore
+/src/utils/request-temp.js
+_roadhog-api-doc
+ant-pro
+
+# production
+/dist
+/.vscode
+
+# misc
+.DS_Store
+npm-debug.log*
+yarn-error.log
+
+/coverage
+.idea
+yarn.lock
+package-lock.json
+*bak
+.vscode
+
+# visual studio code
+.history
+*.log
+
+functions/mock
+.temp/**
+
+# umi
+.umi
+.umi-production
+
+# screenshot
+screenshot
+.firebase
+
+# mine
+testWebpack
+test
+笔记
+面试
+练习题
+测试代码

+ 27 - 0
8_ES6/29_严格模式.html

@@ -0,0 +1,27 @@
+<!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>
+        // "use strict"
+        // a = 10;
+        // console.log(a);
+        // 严格模式下,变量必须先声明后使用
+        
+        // a = 10;
+        b = 10;
+        function foo(){
+            "use strict"
+            // 严格模式有作用域 如果在函数内部生命严格模式仅对函数内部有效
+            // 如果写在函数内 必须写在第一行
+            a = 10;
+            console.log(a);
+        }
+        foo();
+    </script>
+</body>
+</html>

+ 5 - 0
8_ES6/babel/.babelrc

@@ -0,0 +1,5 @@
+{
+    "presets": [
+        "env"
+    ]
+}

+ 7 - 0
8_ES6/babel/dist/test1.js

@@ -0,0 +1,7 @@
+"use strict";
+
+var foo = function foo() {
+    var a = 10;
+    console.log(a);
+};
+foo();

+ 16 - 0
8_ES6/babel/package.json

@@ -0,0 +1,16 @@
+{
+  "name": "babel",
+  "version": "1.0.0",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "keywords": [],
+  "author": "",
+  "license": "ISC",
+  "devDependencies": {
+    "babel-cli": "^6.26.0",
+    "babel-preset-env": "^1.7.0"
+  }
+}

+ 13 - 0
8_ES6/babel/src/exprot.js

@@ -0,0 +1,13 @@
+function foo(){
+    console.log("hello");
+}
+let num = 10;
+
+// export 导出内容
+// 需要导出内容如果只有一个使用 export default 
+// export default foo;
+// 如果导出多个内容 使用 export 导出 后面使用时需要使用 {} 包裹
+export {
+    foo,
+    num
+}

+ 4 - 0
8_ES6/babel/src/import.js

@@ -0,0 +1,4 @@
+// import foo from './exprot.js';
+import {foo, num} from './exprot.js';
+foo();
+console.log(num);

+ 5 - 0
8_ES6/babel/src/test1.js

@@ -0,0 +1,5 @@
+let foo = ()=>{
+    let a = 10;
+    console.log(a);
+}
+foo();