{"action":"created","comment":{"url":"https://api.github.com/repos/ElemeFE/style-guide/pulls/comments/43079797","id":43079797,"diff_hunk":"@@ -112,20 +234,37 @@ var Prefix = 'http://api.ele.me/v1/'\n \n // 推荐\n var PREFIX = 'http://api.ele.me/v1/';\n+// 条件允许时\n+const PREFIX = 'http://api.ele.me/v1/';\n ```\n \n+\n ### 使用字面量\n \n ```js\n-// 不推荐\n-var str = new String('str');\n+// 不建议\n var obj = new Object();\n var array = new Array();\n \n // 推荐\n-var str = '';\n var obj = {};\n var array = [];\n+\n+// 鉴于Array构造函数的特殊性，不允许\n+var arr1 = new Array(1, 2, 3); // [1, 2, 3]\n+var arr2 = new Array(1); // [ undefined * 1 ]\n+\n+// 不允许\n+var str = new String('str');","path":"javascript.md","position":237,"original_position":237,"commit_id":"8c041a7f45f457b509c025cf4970748ad2559f69","original_commit_id":"8c041a7f45f457b509c025cf4970748ad2559f69","user":{"login":"CarterLi","id":6134068,"avatar_url":"https://avatars.githubusercontent.com/u/6134068?v=3","gravatar_id":"","url":"https://api.github.com/users/CarterLi","html_url":"https://github.com/CarterLi","followers_url":"https://api.github.com/users/CarterLi/followers","following_url":"https://api.github.com/users/CarterLi/following{/other_user}","gists_url":"https://api.github.com/users/CarterLi/gists{/gist_id}","starred_url":"https://api.github.com/users/CarterLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarterLi/subscriptions","organizations_url":"https://api.github.com/users/CarterLi/orgs","repos_url":"https://api.github.com/users/CarterLi/repos","events_url":"https://api.github.com/users/CarterLi/events{/privacy}","received_events_url":"https://api.github.com/users/CarterLi/received_events","type":"User","site_admin":false},"body":"这个有什么用？","created_at":"2015-10-27T02:58:39Z","updated_at":"2015-10-27T02:58:39Z","html_url":"https://github.com/ElemeFE/style-guide/pull/12#discussion_r43079797","pull_request_url":"https://api.github.com/repos/ElemeFE/style-guide/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/ElemeFE/style-guide/pulls/comments/43079797"},"html":{"href":"https://github.com/ElemeFE/style-guide/pull/12#discussion_r43079797"},"pull_request":{"href":"https://api.github.com/repos/ElemeFE/style-guide/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/ElemeFE/style-guide/pulls/12","id":45979826,"html_url":"https://github.com/ElemeFE/style-guide/pull/12","diff_url":"https://github.com/ElemeFE/style-guide/pull/12.diff","patch_url":"https://github.com/ElemeFE/style-guide/pull/12.patch","issue_url":"https://api.github.com/repos/ElemeFE/style-guide/issues/12","number":12,"state":"open","locked":false,"title":"Update javascript.md","user":{"login":"CarterLi","id":6134068,"avatar_url":"https://avatars.githubusercontent.com/u/6134068?v=3","gravatar_id":"","url":"https://api.github.com/users/CarterLi","html_url":"https://github.com/CarterLi","followers_url":"https://api.github.com/users/CarterLi/followers","following_url":"https://api.github.com/users/CarterLi/following{/other_user}","gists_url":"https://api.github.com/users/CarterLi/gists{/gist_id}","starred_url":"https://api.github.com/users/CarterLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarterLi/subscriptions","organizations_url":"https://api.github.com/users/CarterLi/orgs","repos_url":"https://api.github.com/users/CarterLi/repos","events_url":"https://api.github.com/users/CarterLi/events{/privacy}","received_events_url":"https://api.github.com/users/CarterLi/received_events","type":"User","site_admin":false},"body":"加入新条款，修复一个bug（自执行函数中）\r\n\r\n某些原有条款的变更：\r\n1、关键字if与左括号之间加空格：与函数调用做区分\r\n2、if、for等语句块只有一行但是换行写时，强制加大括号\r\n3、当已知左右操作数类型相同时，不强制使用```===```比较，比如判断typeof时","created_at":"2015-09-25T06:04:57Z","updated_at":"2015-10-27T02:58:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28ae0eb2978d64fc6c81ef7303ffb77c20a6912a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ElemeFE/style-guide/pulls/12/commits","review_comments_url":"https://api.github.com/repos/ElemeFE/style-guide/pulls/12/comments","review_comment_url":"https://api.github.com/repos/ElemeFE/style-guide/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ElemeFE/style-guide/issues/12/comments","statuses_url":"https://api.github.com/repos/ElemeFE/style-guide/statuses/8c041a7f45f457b509c025cf4970748ad2559f69","head":{"label":"CarterLi:master","ref":"master","sha":"8c041a7f45f457b509c025cf4970748ad2559f69","user":{"login":"CarterLi","id":6134068,"avatar_url":"https://avatars.githubusercontent.com/u/6134068?v=3","gravatar_id":"","url":"https://api.github.com/users/CarterLi","html_url":"https://github.com/CarterLi","followers_url":"https://api.github.com/users/CarterLi/followers","following_url":"https://api.github.com/users/CarterLi/following{/other_user}","gists_url":"https://api.github.com/users/CarterLi/gists{/gist_id}","starred_url":"https://api.github.com/users/CarterLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarterLi/subscriptions","organizations_url":"https://api.github.com/users/CarterLi/orgs","repos_url":"https://api.github.com/users/CarterLi/repos","events_url":"https://api.github.com/users/CarterLi/events{/privacy}","received_events_url":"https://api.github.com/users/CarterLi/received_events","type":"User","site_admin":false},"repo":{"id":43109780,"name":"style-guide","full_name":"CarterLi/style-guide","owner":{"login":"CarterLi","id":6134068,"avatar_url":"https://avatars.githubusercontent.com/u/6134068?v=3","gravatar_id":"","url":"https://api.github.com/users/CarterLi","html_url":"https://github.com/CarterLi","followers_url":"https://api.github.com/users/CarterLi/followers","following_url":"https://api.github.com/users/CarterLi/following{/other_user}","gists_url":"https://api.github.com/users/CarterLi/gists{/gist_id}","starred_url":"https://api.github.com/users/CarterLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarterLi/subscriptions","organizations_url":"https://api.github.com/users/CarterLi/orgs","repos_url":"https://api.github.com/users/CarterLi/repos","events_url":"https://api.github.com/users/CarterLi/events{/privacy}","received_events_url":"https://api.github.com/users/CarterLi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CarterLi/style-guide","description":"style guide for everyone","fork":true,"url":"https://api.github.com/repos/CarterLi/style-guide","forks_url":"https://api.github.com/repos/CarterLi/style-guide/forks","keys_url":"https://api.github.com/repos/CarterLi/style-guide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CarterLi/style-guide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CarterLi/style-guide/teams","hooks_url":"https://api.github.com/repos/CarterLi/style-guide/hooks","issue_events_url":"https://api.github.com/repos/CarterLi/style-guide/issues/events{/number}","events_url":"https://api.github.com/repos/CarterLi/style-guide/events","assignees_url":"https://api.github.com/repos/CarterLi/style-guide/assignees{/user}","branches_url":"https://api.github.com/repos/CarterLi/style-guide/branches{/branch}","tags_url":"https://api.github.com/repos/CarterLi/style-guide/tags","blobs_url":"https://api.github.com/repos/CarterLi/style-guide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CarterLi/style-guide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CarterLi/style-guide/git/refs{/sha}","trees_url":"https://api.github.com/repos/CarterLi/style-guide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CarterLi/style-guide/statuses/{sha}","languages_url":"https://api.github.com/repos/CarterLi/style-guide/languages","stargazers_url":"https://api.github.com/repos/CarterLi/style-guide/stargazers","contributors_url":"https://api.github.com/repos/CarterLi/style-guide/contributors","subscribers_url":"https://api.github.com/repos/CarterLi/style-guide/subscribers","subscription_url":"https://api.github.com/repos/CarterLi/style-guide/subscription","commits_url":"https://api.github.com/repos/CarterLi/style-guide/commits{/sha}","git_commits_url":"https://api.github.com/repos/CarterLi/style-guide/git/commits{/sha}","comments_url":"https://api.github.com/repos/CarterLi/style-guide/comments{/number}","issue_comment_url":"https://api.github.com/repos/CarterLi/style-guide/issues/comments{/number}","contents_url":"https://api.github.com/repos/CarterLi/style-guide/contents/{+path}","compare_url":"https://api.github.com/repos/CarterLi/style-guide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CarterLi/style-guide/merges","archive_url":"https://api.github.com/repos/CarterLi/style-guide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CarterLi/style-guide/downloads","issues_url":"https://api.github.com/repos/CarterLi/style-guide/issues{/number}","pulls_url":"https://api.github.com/repos/CarterLi/style-guide/pulls{/number}","milestones_url":"https://api.github.com/repos/CarterLi/style-guide/milestones{/number}","notifications_url":"https://api.github.com/repos/CarterLi/style-guide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CarterLi/style-guide/labels{/name}","releases_url":"https://api.github.com/repos/CarterLi/style-guide/releases{/id}","created_at":"2015-09-25T04:32:27Z","updated_at":"2015-09-24T12:22:48Z","pushed_at":"2015-09-25T06:59:28Z","git_url":"git://github.com/CarterLi/style-guide.git","ssh_url":"git@github.com:CarterLi/style-guide.git","clone_url":"https://github.com/CarterLi/style-guide.git","svn_url":"https://github.com/CarterLi/style-guide","homepage":"","size":173,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ElemeFE:master","ref":"master","sha":"dd652082d0b981a0534d1295071db699827222c0","user":{"login":"ElemeFE","id":12810740,"avatar_url":"https://avatars.githubusercontent.com/u/12810740?v=3","gravatar_id":"","url":"https://api.github.com/users/ElemeFE","html_url":"https://github.com/ElemeFE","followers_url":"https://api.github.com/users/ElemeFE/followers","following_url":"https://api.github.com/users/ElemeFE/following{/other_user}","gists_url":"https://api.github.com/users/ElemeFE/gists{/gist_id}","starred_url":"https://api.github.com/users/ElemeFE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElemeFE/subscriptions","organizations_url":"https://api.github.com/users/ElemeFE/orgs","repos_url":"https://api.github.com/users/ElemeFE/repos","events_url":"https://api.github.com/users/ElemeFE/events{/privacy}","received_events_url":"https://api.github.com/users/ElemeFE/received_events","type":"Organization","site_admin":false},"repo":{"id":21231697,"name":"style-guide","full_name":"ElemeFE/style-guide","owner":{"login":"ElemeFE","id":12810740,"avatar_url":"https://avatars.githubusercontent.com/u/12810740?v=3","gravatar_id":"","url":"https://api.github.com/users/ElemeFE","html_url":"https://github.com/ElemeFE","followers_url":"https://api.github.com/users/ElemeFE/followers","following_url":"https://api.github.com/users/ElemeFE/following{/other_user}","gists_url":"https://api.github.com/users/ElemeFE/gists{/gist_id}","starred_url":"https://api.github.com/users/ElemeFE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElemeFE/subscriptions","organizations_url":"https://api.github.com/users/ElemeFE/orgs","repos_url":"https://api.github.com/users/ElemeFE/repos","events_url":"https://api.github.com/users/ElemeFE/events{/privacy}","received_events_url":"https://api.github.com/users/ElemeFE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ElemeFE/style-guide","description":"style guide for everyone","fork":false,"url":"https://api.github.com/repos/ElemeFE/style-guide","forks_url":"https://api.github.com/repos/ElemeFE/style-guide/forks","keys_url":"https://api.github.com/repos/ElemeFE/style-guide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ElemeFE/style-guide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ElemeFE/style-guide/teams","hooks_url":"https://api.github.com/repos/ElemeFE/style-guide/hooks","issue_events_url":"https://api.github.com/repos/ElemeFE/style-guide/issues/events{/number}","events_url":"https://api.github.com/repos/ElemeFE/style-guide/events","assignees_url":"https://api.github.com/repos/ElemeFE/style-guide/assignees{/user}","branches_url":"https://api.github.com/repos/ElemeFE/style-guide/branches{/branch}","tags_url":"https://api.github.com/repos/ElemeFE/style-guide/tags","blobs_url":"https://api.github.com/repos/ElemeFE/style-guide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ElemeFE/style-guide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ElemeFE/style-guide/git/refs{/sha}","trees_url":"https://api.github.com/repos/ElemeFE/style-guide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ElemeFE/style-guide/statuses/{sha}","languages_url":"https://api.github.com/repos/ElemeFE/style-guide/languages","stargazers_url":"https://api.github.com/repos/ElemeFE/style-guide/stargazers","contributors_url":"https://api.github.com/repos/ElemeFE/style-guide/contributors","subscribers_url":"https://api.github.com/repos/ElemeFE/style-guide/subscribers","subscription_url":"https://api.github.com/repos/ElemeFE/style-guide/subscription","commits_url":"https://api.github.com/repos/ElemeFE/style-guide/commits{/sha}","git_commits_url":"https://api.github.com/repos/ElemeFE/style-guide/git/commits{/sha}","comments_url":"https://api.github.com/repos/ElemeFE/style-guide/comments{/number}","issue_comment_url":"https://api.github.com/repos/ElemeFE/style-guide/issues/comments{/number}","contents_url":"https://api.github.com/repos/ElemeFE/style-guide/contents/{+path}","compare_url":"https://api.github.com/repos/ElemeFE/style-guide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ElemeFE/style-guide/merges","archive_url":"https://api.github.com/repos/ElemeFE/style-guide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ElemeFE/style-guide/downloads","issues_url":"https://api.github.com/repos/ElemeFE/style-guide/issues{/number}","pulls_url":"https://api.github.com/repos/ElemeFE/style-guide/pulls{/number}","milestones_url":"https://api.github.com/repos/ElemeFE/style-guide/milestones{/number}","notifications_url":"https://api.github.com/repos/ElemeFE/style-guide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ElemeFE/style-guide/labels{/name}","releases_url":"https://api.github.com/repos/ElemeFE/style-guide/releases{/id}","created_at":"2014-06-26T07:18:57Z","updated_at":"2015-10-16T12:20:56Z","pushed_at":"2015-10-26T14:51:17Z","git_url":"git://github.com/ElemeFE/style-guide.git","ssh_url":"git@github.com:ElemeFE/style-guide.git","clone_url":"https://github.com/ElemeFE/style-guide.git","svn_url":"https://github.com/ElemeFE/style-guide","homepage":"","size":337,"stargazers_count":37,"watchers_count":37,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":3,"forks":13,"open_issues":3,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ElemeFE/style-guide/pulls/12"},"html":{"href":"https://github.com/ElemeFE/style-guide/pull/12"},"issue":{"href":"https://api.github.com/repos/ElemeFE/style-guide/issues/12"},"comments":{"href":"https://api.github.com/repos/ElemeFE/style-guide/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/ElemeFE/style-guide/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/ElemeFE/style-guide/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ElemeFE/style-guide/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/ElemeFE/style-guide/statuses/8c041a7f45f457b509c025cf4970748ad2559f69"}}}}