美文网首页
js各类型转化

js各类型转化

作者: Sasoli | 来源:发表于2019-06-20 15:40 被阅读0次

    String to Number

    • Number(str)
    • +str

    Number to String

    • toString(num)
    • ""+num

    All to Boolean

    • Boolean(value)
    • !!value

    Object to JSON

    • JSON.stringify(obj)

    JSON to Object

    • JSON.parse(obj)

    相关文章

      网友评论

          本文标题:js各类型转化

          本文链接:https://www.haomeiwen.com/subject/gzhjqctx.html