我总是通过向它们添加一个空字符串将数字转换为字符串:
var string = 1 + '';
但是,JSLint抱怨这种方法Expected 'String' and instead saw ''''.,看起来确实有些难看.
Expected 'String' and instead saw ''''.
有没有更好的办法?
javascript jslint
javascript ×1
jslint ×1