{"id":558,"date":"2023-09-16T17:32:01","date_gmt":"2023-09-16T09:32:01","guid":{"rendered":""},"modified":"2023-09-17T00:41:33","modified_gmt":"2023-09-16T16:41:33","slug":"%e6%95%b0%e7%bb%84%e8%bd%ac%e5%ad%97%e7%ac%a6%e4%b8%b2%e7%9a%84%e6%96%b9%e6%b3%95%ef%bc%883%e7%a7%8d%ef%bc%89","status":"publish","type":"post","link":"https:\/\/mushiming.com\/558.html","title":{"rendered":"\u6570\u7ec4\u8f6c\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\uff083\u79cd\uff09"},"content":{"rendered":"

\n <\/path> \n<\/svg> <\/p>\n

\u6570\u7ec4\u8f6c\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\uff083\u79cd\uff09<\/strong><\/h2>\n\n\n\n\n\n\n\n
\u65b9\u6cd5<\/th>\n\u8f6c\u5316\u540e\u7c7b\u578b<\/th>\n\u7528\u6cd5<\/th>\n\u7279\u70b9<\/th>\n<\/tr>\n<\/thead>\n
toString()<\/td>\nstring<\/td>\n\u5c06\u6570\u7ec4\u8f6c\u6362\u6210\u4e00\u4e2a\u5b57\u7b26\u4e32<\/td>\n\u9ed8\u8ba4\u7528\u201c,\u201d\u9694\u5f00<\/td>\n<\/tr>\n
toLocaleString()<\/td>\nstring<\/td>\n\u628a\u6570\u7ec4\u8f6c\u6362\u6210\u672c\u5730\u7ea6\u5b9a\u7684\u5b57\u7b26\u4e32<\/td>\n\u9ed8\u8ba4\u7528\u201c,\u201d\u9694\u5f00<\/td>\n<\/tr>\n
join()<\/td>\nstring<\/td>\n\u5c06\u6570\u7ec4\u5143\u7d20\u8fde\u63a5\u8d77\u6765\u4ee5\u6784\u5efa\u4e00\u4e2a\u5b57\u7b26\u4e32<\/td>\n\u53ef\u4ee5\u968f\u610f\u8bbe\u5b9a\u5206\u9694\u7b26<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u4e0b\u9762\u6211\u4eec\u770b\u4e0b\u60c5\u51b5
1\u3001toString()<\/strong><\/p>\n

\t<<\/span>script type=<\/span>\"text\/javascript\"<\/span>><\/span>\n\t\tvar<\/span> a=<\/span>[<\/span>1<\/span>,<\/span>2<\/span>,<\/span>3<\/span>,<\/span>4<\/span>,<\/span>5<\/span>,<\/span>6<\/span>,<\/span>7<\/span>,<\/span>8<\/span>,<\/span>9<\/span>,<\/span>0<\/span>]<\/span>;<\/span>\/\/\u539f\u6570\u7ec4<\/span>\n\t\tvar<\/span> b=<\/span>a.<\/span>toString<\/span>(<\/span>)<\/span>;<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>a)<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>b)<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>typeof<\/span>(<\/span>a)<\/span>)<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>typeof<\/span>(<\/span>b)<\/span>)<\/span>\n\t<<\/span>\/<\/span>script><\/span>\n<\/code><\/pre>\n

\"\u6570\u7ec4\u8f6c\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\uff083\u79cd\uff09
2\u3001toLocaleString()<\/strong><\/p>\n

\t<<\/span>script type=<\/span>\"text\/javascript\"<\/span>><\/span>\n\t\tvar<\/span> a=<\/span>[<\/span>1<\/span>,<\/span>2<\/span>,<\/span>3<\/span>,<\/span>4<\/span>,<\/span>5<\/span>,<\/span>6<\/span>,<\/span>7<\/span>,<\/span>8<\/span>,<\/span>9<\/span>,<\/span>0<\/span>]<\/span>;<\/span>\/\/\u539f\u6570\u7ec4<\/span>\n\t\tvar<\/span> d=<\/span>a.<\/span>toLocaleString<\/span>(<\/span>)<\/span>;<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>d)<\/span>;<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>typeof<\/span>(<\/span>d)<\/span>)<\/span>;<\/span>\n\t<<\/span>\/<\/span>script><\/span>\n<\/code><\/pre>\n

\"\u6570\u7ec4\u8f6c\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\uff083\u79cd\uff09<\/p>\n

3\u3001join()<\/strong><\/p>\n

\t<<\/span>script type=<\/span>\"text\/javascript\"<\/span>><\/span>\n\t\tvar<\/span> a=<\/span>[<\/span>1<\/span>,<\/span>2<\/span>,<\/span>3<\/span>,<\/span>4<\/span>,<\/span>5<\/span>,<\/span>6<\/span>,<\/span>7<\/span>,<\/span>8<\/span>,<\/span>9<\/span>,<\/span>0<\/span>]<\/span>;<\/span>\/\/\u539f\u6570\u7ec4<\/span>\n\t\tvar<\/span> c=<\/span>a.<\/span>join<\/span>(<\/span>':'<\/span>)<\/span>;<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>c)<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>typeof<\/span>(<\/span>c)<\/span>)<\/span>\n\t<<\/span>\/<\/span>script><\/span>\n<\/code><\/pre>\n

\"\u6570\u7ec4\u8f6c\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\uff083\u79cd\uff09<\/p>\n

4.split<\/strong>
\u4f7f\u7528 split() \u65b9\u6cd5\u628a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6570\u7ec4<\/p>\n

\t<<\/span>script type=<\/span>\"text\/javascript\"<\/span>><\/span>\n\t\tvar<\/span> a=<\/span>[<\/span>1<\/span>,<\/span>2<\/span>,<\/span>3<\/span>,<\/span>4<\/span>,<\/span>5<\/span>,<\/span>6<\/span>,<\/span>7<\/span>,<\/span>8<\/span>,<\/span>9<\/span>,<\/span>0<\/span>]<\/span>;<\/span>\/\/\u539f\u6570\u7ec4<\/span>\n\t\tvar<\/span> b=<\/span>a.<\/span>toString<\/span>(<\/span>)<\/span>;<\/span>\n\t\tvar<\/span> c=<\/span>a.<\/span>join<\/span>(<\/span>':'<\/span>)<\/span>;<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>b)<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>c)<\/span>\n\t\t\n\t\tvar<\/span> bv=<\/span>b.<\/span>split<\/span>(<\/span>','<\/span>)<\/span>;<\/span>\n\t\tvar<\/span> cv=<\/span>c.<\/span>split<\/span>(<\/span>':'<\/span>)<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>bv)<\/span>;<\/span>\n\t\tconsole.<\/span>log<\/span>(<\/span>cv)<\/span>;<\/span>\n\t<<\/span>\/<\/span>script><\/span>\n<\/code><\/pre>\n

\"\u6570\u7ec4\u8f6c\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\uff083\u79cd\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"\u6570\u7ec4\u8f6c\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\uff083\u79cd\uff09\u6570\u7ec4\u8f6c\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\uff083\u79cd\uff09\u65b9\u6cd5\u8f6c\u5316\u540e\u7c7b\u578b\u7528\u6cd5\u7279\u70b9toString()string\u5c06\u6570\u7ec4\u8f6c\u6362\u6210\u4e00\u4e2a\u5b57\u7b26\u4e32\u9ed8\u8ba4\u7528\u201c...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/558"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=558"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/558\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}