Title: The Good Parts - learning logs · Issue #6 · K0II/JavaScript · GitHub
Open Graph Title: The Good Parts - learning logs · Issue #6 · K0II/JavaScript
X Title: The Good Parts - learning logs · Issue #6 · K0II/JavaScript
Description: 扩充类型的功能 ( Augmenting Types ) // 给 Function.prototype 添加方法(符合条件时) 来使该方法对所有函数可用 Function.prototype.method = function (name, func) { if (!this.prototype[name]) { this.prototype[name] = func; } return this; } // 提取数字中的整数部分 Math.ceil()向上取整,Ma...
Open Graph Description: 扩充类型的功能 ( Augmenting Types ) // 给 Function.prototype 添加方法(符合条件时) 来使该方法对所有函数可用 Function.prototype.method = function (name, func) { if (!this.prototype[name]) { this.prototype[name] = func; } return ...
X Description: 扩充类型的功能 ( Augmenting Types ) // 给 Function.prototype 添加方法(符合条件时) 来使该方法对所有函数可用 Function.prototype.method = function (name, func) { if (!this.prototype[name]) { this.prototype[name] = func; } return ...
Opengraph URL: https://github.com/K0II/JavaScript/issues/6
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The Good Parts - learning logs","articleBody":"### 扩充类型的功能 ( Augmenting Types )\n\n``` javascript\n// 给 Function.prototype 添加方法(符合条件时) 来使该方法对所有函数可用\nFunction.prototype.method = function (name, func) {\n if (!this.prototype[name]) {\n this.prototype[name] = func;\n }\n return this;\n}\n\n// 提取数字中的整数部分 Math.ceil()向上取整,Math.floor()向下取整\nNumber.method('integer', function () {\n return Math[this \u003c 0 ? 'ceil' : 'floor'](this);\n});\n\n// 移除字符串首尾空白\nString.method('trim', function(){\n return this.replace(/^\\s+|\\s+$/g, '');\n});\n```\n","author":{"url":"https://github.com/K0II","@type":"Person","name":"K0II"},"datePublished":"2016-05-27T10:36:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/6/JavaScript/issues/6"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4e208798-1686-0863-ebaf-2427d35ff1c7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A9E0:37E3D3:66828CC:8F60F55:6A5025D2 |
| html-safe-nonce | d3421699a1a9abfcd9923c2901d49f673c828a6eb627a0854bb8fe6f80f7e8ea |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUUwOjM3RTNEMzo2NjgyOENDOjhGNjBGNTU6NkE1MDI1RDIiLCJ2aXNpdG9yX2lkIjoiNTg4NTE0OTAyMDM4NTQ1MzUyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8bf6a5498cdec1b24a59c0270fced037053707b5556143424da538a9a0ddc184 |
| hovercard-subject-tag | issue:157178171 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/K0II/JavaScript/6/issue_layout |
| twitter:image | https://opengraph.githubassets.com/278187e13a6ffe3757ecc3f5ea07aaf3dd0602044867c04f64a6aa1b9a5b3ef4/K0II/JavaScript/issues/6 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/278187e13a6ffe3757ecc3f5ea07aaf3dd0602044867c04f64a6aa1b9a5b3ef4/K0II/JavaScript/issues/6 |
| og:image:alt | 扩充类型的功能 ( Augmenting Types ) // 给 Function.prototype 添加方法(符合条件时) 来使该方法对所有函数可用 Function.prototype.method = function (name, func) { if (!this.prototype[name]) { this.prototype[name] = func; } return ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | K0II |
| hostname | github.com |
| expected-hostname | github.com |
| None | a08040246389072795e3b4e7b33c6d9a0c564eee02e829a809326d67c418b069 |
| turbo-cache-control | no-preview |
| go-import | github.com/K0II/JavaScript git https://github.com/K0II/JavaScript.git |
| octolytics-dimension-user_id | 19141974 |
| octolytics-dimension-user_login | K0II |
| octolytics-dimension-repository_id | 57857936 |
| octolytics-dimension-repository_nwo | K0II/JavaScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 57857936 |
| octolytics-dimension-repository_network_root_nwo | K0II/JavaScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d1b91b18e7330fc458dfd824c61eaed7daa830d6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width