{"id":77,"date":"2021-01-17T19:56:11","date_gmt":"2021-01-17T11:56:11","guid":{"rendered":"http:\/\/gjweb.top\/?p=77"},"modified":"2021-01-17T20:04:37","modified_gmt":"2021-01-17T12:04:37","slug":"number","status":"publish","type":"post","link":"https:\/\/gjweb.top\/?p=77","title":{"rendered":"number\u7c7b\u578b"},"content":{"rendered":"\n<p>es5\u4e2d\u7684 <strong>parseInt()<\/strong> <strong>parseFloat()<\/strong> \u90fd\u5728\u5168\u5c40\u5bf9\u8c61\u4e0b(window)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Number.parseInt() \/\/ \u53d6\u6574\u6570\nNumber.parseFlote() \/\/\u53d6\u5c0f\u6570\nNumber.isFinite() \/\/\u68c0\u67e5\u4e00\u4e2a\u6570\u503c\u662f\u5426\u6709\u9650\nNumber,isNaN() \/\/ \u68c0\u67e5\u4e00\u4e2a\u6570\u503c\u662f\u5426\u662fNaN\nNumber.isInteger() \/\/ \u5224\u65ad\u4e00\u4e2a\u6570\u503c\u662f\u5426\u662f\u6574\u6570<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Math<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>Math.ceil(num) \/\/\u5411\u4e0a\u53d6\u6574\nMath.floor(num) \/\/ \u5411\u4e0b\u53d6\u6574\nMath.round(num) \/\/ \u8fd4\u56de\u6574\u6570\nMath.toFixed(n) \/\/ \u4fdd\u7559\u4efb\u610fN\u4f4d\u5c0f\u6570\nMath.pow(10,2) \/\/ \u4e58\u65b9\nMath.aqrt(num) \/\/ \u5f00\u65b9\nMath.max(nums) Math.min(nums) \/\/ \u6700\u5927\u503c\/\u6700\u5c0f\u503c(\u4e0d\u652f\u6301\u6570\u7ec4)\nMath.max.apply(null,arr)\/Math.max(...arr) \/\/ \u6700\u5927\u503c\/\u6700\u5c0f\u503c(\u652f\u6301\u6570\u7ec4)\nMath.min.apply(null,arr)\/Math.min(...arr) \/\/ \u6700\u5927\u503c\/\u6700\u5c0f\u503c(ES6\u7b80\u5316)<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Date<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>var ms = date.getTime(); <\/code><\/pre>\n\n\n\n<p>API\u5355\u4f4d\uff1a<strong>Fullyear<\/strong> \u3001<strong>Month<\/strong>\u3001 <strong>Date<\/strong>\u3001 <strong>Day<\/strong>\u3001<strong>Hours<\/strong>\u3001 <strong>Minutes<\/strong>\u3001 <strong>Seconds<\/strong>\u3001<strong>Milliseconds<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u8c03\u7528\ngetxxx(); \/\/ \u83b7\u53d6\nsetxxx(); \/\/ \u8bbe\u7f6e<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>es5\u4e2d\u7684 parseInt() parseFloat() \u90fd\u5728\u5168\u5c40\u5bf9\u8c61\u4e0b(window) Math Date [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=77"}],"version-history":[{"count":0,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/77\/revisions"}],"wp:attachment":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}