{"id":405,"date":"2020-02-14T14:04:20","date_gmt":"2020-02-14T06:04:20","guid":{"rendered":"https:\/\/blog.cqdefxxx.com\/?p=405"},"modified":"2020-02-14T14:04:20","modified_gmt":"2020-02-14T06:04:20","slug":"%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b%e7%9a%84%e5%88%86%e7%b1%bb%e5%92%8c%e5%88%a4%e6%96%ad","status":"publish","type":"post","link":"https:\/\/blog.viter.top\/index.php\/2020\/02\/14\/%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b%e7%9a%84%e5%88%86%e7%b1%bb%e5%92%8c%e5%88%a4%e6%96%ad\/","title":{"rendered":"\u6570\u636e\u7c7b\u578b\u7684\u5206\u7c7b\u548c\u5224\u65ad"},"content":{"rendered":"<pre class=\"pure-highlightjs\"><code class=\"\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n  &lt;meta charset=\"UTF-8\"&gt;\n  &lt;title&gt;01_\u6570\u636e\u7c7b\u578b&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;!--\n1. \u5206\u7c7b\n  * \u57fa\u672c(\u503c)\u7c7b\u578b\n    * String: \u4efb\u610f\u5b57\u7b26\u4e32\n    * Number: \u4efb\u610f\u7684\u6570\u5b57\n    * boolean: true\/false\n    * undefined: undefined\n    * null: null\n  * \u5bf9\u8c61(\u5f15\u7528)\u7c7b\u578b\n    * Object: \u4efb\u610f\u5bf9\u8c61\n    * Function: \u4e00\u79cd\u7279\u522b\u7684\u5bf9\u8c61(\u53ef\u4ee5\u6267\u884c)\n    * Array: \u4e00\u79cd\u7279\u522b\u7684\u5bf9\u8c61(\u6570\u503c\u4e0b\u6807, \u5185\u90e8\u6570\u636e\u662f\u6709\u5e8f\u7684)\n2. \u5224\u65ad\n  * typeof:\n    * \u53ef\u4ee5\u5224\u65ad: undefined\/ \u6570\u503c \/ \u5b57\u7b26\u4e32 \/ \u5e03\u5c14\u503c \/ function\n    * \u4e0d\u80fd\u5224\u65ad: null\u4e0eobject  object\u4e0earray\n  * instanceof:\n    * \u5224\u65ad\u5bf9\u8c61\u7684\u5177\u4f53\u7c7b\u578b\n  * ===\n    * \u53ef\u4ee5\u5224\u65ad: undefined, null\n--&gt;\n\n&lt;script type=\"text\/javascript\"&gt;\n  \/\/1. \u57fa\u672c\n  \/\/ typeof\u8fd4\u56de\u6570\u636e\u7c7b\u578b\u7684\u5b57\u7b26\u4e32\u8868\u8fbe\n  var a\n  console.log(a, typeof a, typeof a==='undefined',a===undefined )  \/\/ undefined 'undefined' true true\n  console.log(undefined==='undefined')\n  a = 4\n  console.log(typeof a==='number')\n  a = 'atguigu'\n  console.log(typeof a==='string')\n  a = true\n  console.log(typeof a==='boolean')\n  a = null\n  console.log(typeof a, a===null) \/\/ 'object'\n\n  console.log('-----------------')\n  \/\/2. \u5bf9\u8c61\n  var b1 = {\n    b2: [1, 'abc', console.log],\n    b3: function () {\n      console.log('b3')\n      return function () {\n        return 'xfzhang'\n      }\n    }\n  }\n\n  console.log(b1 instanceof Object, b1 instanceof Array) \/\/ true  false\n  console.log(b1.b2 instanceof Array, b1.b2 instanceof Object) \/\/ true true\n  console.log(b1.b3 instanceof Function, b1.b3 instanceof Object) \/\/ true true\n\n  console.log(typeof b1.b2, '-------') \/\/ 'object'\n\n  console.log(typeof b1.b3==='function') \/\/ true\n\n  console.log(typeof b1.b2[2]==='function')\n  b1.b2[2](4)\n  console.log(b1.b3()())\n\n\n\n  \/*var obj = {\n    name: 'Tom',\n    age: 12\n  }\n  function test () {\n    var a = 3\n  }\n  var arr = [3, 'abc']\n  arr[1]*\/\n\n&lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n  &lt;meta charset=\"UTF-8\"&gt;\n  &lt;title&gt;01_\u76f8\u5173\u95ee\u9898&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;!--\n1. undefined\u4e0enull\u7684\u533a\u522b?\n  * undefined\u4ee3\u8868\u5b9a\u4e49\u672a\u8d4b\u503c\n  * nulll\u5b9a\u4e49\u5e76\u8d4b\u503c\u4e86, \u53ea\u662f\u503c\u4e3anull\n2. \u4ec0\u4e48\u65f6\u5019\u7ed9\u53d8\u91cf\u8d4b\u503c\u4e3anull\u5462?\n  * \u521d\u59cb\u8d4b\u503c, \u8868\u660e\u5c06\u8981\u8d4b\u503c\u4e3a\u5bf9\u8c61\n  * \u7ed3\u675f\u524d, \u8ba9\u5bf9\u8c61\u6210\u4e3a\u5783\u573e\u5bf9\u8c61(\u88ab\u5783\u573e\u56de\u6536\u5668\u56de\u6536)\n3. \u4e25\u683c\u533a\u522b\u53d8\u91cf\u7c7b\u578b\u4e0e\u6570\u636e\u7c7b\u578b?\n  * \u6570\u636e\u7684\u7c7b\u578b\n    * \u57fa\u672c\u7c7b\u578b\n    * \u5bf9\u8c61\u7c7b\u578b\n  * \u53d8\u91cf\u7684\u7c7b\u578b(\u53d8\u91cf\u5185\u5b58\u503c\u7684\u7c7b\u578b)\n    * \u57fa\u672c\u7c7b\u578b: \u4fdd\u5b58\u5c31\u662f\u57fa\u672c\u7c7b\u578b\u7684\u6570\u636e\n    * \u5f15\u7528\u7c7b\u578b: \u4fdd\u5b58\u7684\u662f\u5730\u5740\u503c\n--&gt;\n\n&lt;script type=\"text\/javascript\"&gt;\n\n  \/\/ \u5b9e\u4f8b: \u5b9e\u4f8b\u5bf9\u8c61\n  \/\/ \u7c7b\u578b: \u7c7b\u578b\u5bf9\u8c61\n  function Person (name, age) {\/\/ \u6784\u9020\u51fd\u6570  \u7c7b\u578b\n    this.name = name\n    this.age = age\n  }\n  var p = new Person('tom', 12) \/\/ \u6839\u636e\u7c7b\u578b\u521b\u5efa\u7684\u5b9e\u4f8b\u5bf9\u8c61\n\n  \/\/ Person('jack', 12)\n\n  \/\/ 1. undefined\u4e0enull\u7684\u533a\u522b?\n  var a\n  console.log(a)  \/\/ undefined\n  a = null\n  console.log(a) \/\/ null\n\n  \/\/\u8d77\u59cb\n  var b = null  \/\/ \u521d\u59cb\u8d4b\u503c\u4e3anull, \u8868\u660e\u5c06\u8981\u8d4b\u503c\u4e3a\u5bf9\u8c61\n  \/\/\u786e\u5b9a\u5bf9\u8c61\u5c31\u8d4b\u503c\n  b = ['atguigu', 12]\n  \/\/\u6700\u540e\n  b = null \/\/ \u8ba9b\u6307\u5411\u7684\u5bf9\u8c61\u6210\u4e3a\u5783\u573e\u5bf9\u8c61(\u88ab\u5783\u573e\u56de\u6536\u5668\u56de\u6536)\n  \/\/ b = 2\n\n  var c = function () {\n\n  }\n\n  console.log(typeof c) \/\/ 'function'\n\n&lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;!DOCTYPE html&gt; &lt;html lang=&#8221;en&#8221;&gt; &lt;head&gt; &lt;met","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[5],"_links":{"self":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts\/405"}],"collection":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/comments?post=405"}],"version-history":[{"count":0,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts\/405\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/media?parent=405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/categories?post=405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/tags?post=405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}