JavaScript/String:修订间差异
来自康健生活
小 文字替换 -“{{leftrightflex|”替换为“{{Double-columns|” |
|||
| 第3行: | 第3行: | ||
防止被转义。 | 防止被转义。 | ||
{{ | {{Double-columns|<syntaxhighlight lang="javascript"> | ||
String.raw`\u00A2`;</syntaxhighlight>|{{consoleout|<pre>'\\u00A2' | String.raw`\u00A2`;</syntaxhighlight>|{{consoleout|<pre>'\\u00A2' | ||
</pre>}}}} | </pre>}}}} | ||
== 排序 == | == 排序 == | ||
{{ | {{Double-columns|<syntaxhighlight lang="javascript"> | ||
const equaldata = [ | const equaldata = [ | ||
'/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/style/foo.less', | '/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/style/foo.less', | ||
2026年11月26日 (四) 07:50的最新版本
引言
转义
防止被转义。
String.raw`\u00A2`;
'\\u00A2'
排序
const equaldata = [
'/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/style/foo.less',
'/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/bar.less',
'/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/common/qux.less',
'/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/style/biz.less',
'/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/fonts/DS-DIGI.ttf',
'/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/bg.png',
'/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/bg2.png'
].sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
[ '/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/bar.less', '/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/bg.png', '/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/bg2.png', '/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/common/qux.less', '/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/fonts/DS-DIGI.ttf', '/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/style/biz.less', '/Users/kangjian/360/dora/td-deadfile/kk/kk-css-exporter/test/resource/style/foo.less' ]
面试题
No categories