{"id":5482,"date":"2023-01-05T12:45:11","date_gmt":"2023-01-05T04:45:11","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=5482"},"modified":"2023-01-05T12:45:11","modified_gmt":"2023-01-05T04:45:11","slug":"%e5%ad%b8%e7%bf%92%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8typescript%e9%99%a3%e5%88%97%e6%b1%82%e5%8f%96%e6%9c%80%e5%a4%a7%e5%80%bc","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/typescript\/%e5%ad%b8%e7%bf%92%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8typescript%e9%99%a3%e5%88%97%e6%b1%82%e5%8f%96%e6%9c%80%e5%a4%a7%e5%80%bc\/","title":{"rendered":"\u5b78\u7fd2\u5982\u4f55\u4f7f\u7528TypeScript\u9663\u5217\u6c42\u53d6\u6700\u5927\u503c"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"TypeScript, \u9663\u5217, \u6c42\u6700\u5927\u503c, max\"><\/p>\n<h1>\u4f7f\u7528 TypeScript \u9663\u5217\u7684\u6c42\u6700\u5927\u503c(max)<\/h1>\n<p>TypeScript \u662f\u4e00\u7a2e JavaScript \u7684\u8d85\u96c6\uff0c\u5b83\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u5bb9\u6613\u5730\u958b\u767c\u51fa\u66f4\u9ad8\u54c1\u8cea\u7684\u7a0b\u5f0f\u78bc\u3002\u5728 TypeScript \u4e2d\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u4f7f\u7528\u9663\u5217\u4f86\u6c42\u51fa\u6700\u5927\u503c\uff0c\u9019\u5c0d\u65bc\u958b\u767c\u8005\u4f86\u8aaa\u662f\u975e\u5e38\u6709\u7528\u7684\u3002<\/p>\n<h2>TypeScript \u9663\u5217\u7684\u6c42\u6700\u5927\u503c(max)<\/h2>\n<p>\u5728 TypeScript \u4e2d\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u4f7f\u7528 <span style=\"color: #009900; font-weight: bold;\">Math.max()<\/span> \u65b9\u6cd5\u4f86\u6c42\u51fa\u9663\u5217\u4e2d\u7684\u6700\u5927\u503c\u3002\u8a72\u65b9\u6cd5\u63a5\u53d7\u4e00\u500b\u53c3\u6578\uff0c\u5373\u8981\u6c42\u6700\u5927\u503c\u7684\u9663\u5217\uff0c\u4e26\u8fd4\u56de\u8a72\u9663\u5217\u4e2d\u7684\u6700\u5927\u503c\u3002<\/p>\n<pre class=\"brush: typescript\">\nlet numbers = [1, 2, 3, 4, 5];\nlet max = Math.max(...numbers);\nconsole.log(max); \/\/ 5\n<\/pre>\n<p><!--more--><\/p>\n<p>\u5728\u4e0a\u9762\u7684\u7a0b\u5f0f\u78bc\u4e2d\uff0c\u6211\u5011\u5b9a\u7fa9\u4e86\u4e00\u500b\u540d\u70ba numbers \u7684\u9663\u5217\uff0c\u4e26\u4f7f\u7528 Math.max() \u65b9\u6cd5\u6c42\u51fa\u8a72\u9663\u5217\u4e2d\u7684\u6700\u5927\u503c\u3002\u8a72\u65b9\u6cd5\u63a5\u53d7\u4e00\u500b\u53c3\u6578\uff0c\u5373\u8981\u6c42\u6700\u5927\u503c\u7684\u9663\u5217\uff0c\u4e26\u8fd4\u56de\u8a72\u9663\u5217\u4e2d\u7684\u6700\u5927\u503c\u3002<\/p>\n<h2>\u7e3d\u7d50<\/h2>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u8a0e\u8ad6\u4e86\u5982\u4f55\u4f7f\u7528 TypeScript \u4e2d\u7684 Math.max() \u65b9\u6cd5\u4f86\u6c42\u51fa\u9663\u5217\u4e2d\u7684\u6700\u5927\u503c\u3002\u8a72\u65b9\u6cd5\u63a5\u53d7\u4e00\u500b\u53c3\u6578\uff0c\u5373\u8981\u6c42\u6700\u5927\u503c\u7684\u9663\u5217\uff0c\u4e26\u8fd4\u56de\u8a72\u9663\u5217\u4e2d\u7684\u6700\u5927\u503c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u4f7f\u7528TypeScript\u9663\u5217\u6c42\u53d6\u6700\u5927\u503c\uff0c\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528TypeScript\u4e2d\u7684max()\u51fd\u6578\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u5b83\u4f86\u6c42\u53d6\u9663\u5217\u4e2d\u7684\u6700\u5927\u503c\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[187],"tags":[186],"class_list":["post-5482","post","type-post","status-publish","format-standard","hentry","category-typescript","tag-typescript"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pcFK27-1qq","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/comments?post=5482"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5482\/revisions"}],"predecessor-version":[{"id":5483,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5482\/revisions\/5483"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=5482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=5482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=5482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}