其他分享
首页 > 其他分享> > JS 杂项

JS 杂项

作者:互联网

#1.

   +"1"

1
!!1
true
!!0
false   text="aaaa1111"
"aaaa1111"
pattern=/\d+/g//
  /\d+/g
text.search(pattern)
4
text.match(pattern)
  Array [ "1111" ]
text.replace(pattern,"2222")
"aaaa2222"
text.split(/\D+/)
  Array [ "", "1111" ]   0!==0
false
null!=undefined
false
null!==undefined
true
null==undefined
true
null===undefined
false   var s="1111";
function f(){
    console.log(s)
    var s='2222'
    console.log(s)
}

标签:console,log,text,2222,JS,1111,pattern,杂项
来源: https://www.cnblogs.com/KAstandardization/p/14110318.html