侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

js技巧

2024-05-15 星期三 / 0 评论 / 0 点赞 / 98 阅读 / 730 字

1.提取数据类型 function getType(value){ //基本上可以返回所有的类型,不论你是自定义还是原生 return Object.prototype.toString.ca

1.提取数据类型 function getType(value){  //基本上可以返回所有的类型,不论你是自定义还是原生    return Object.prototype.toString.call(value).match(//s{1}(/w+)/)[1];}let obj = new Object();console.log(getType(obj));2.单词首字母大写popLastChecked:function(type){    if(this.lastChecked&&this.lastChecked.length>1&&this.lastChecked.slice(-1)==type){        var tmp=this.lastChecked[this.lastChecked.length-2];        console.log('1:'+tmp);        this.lastChecked.push(tmp);    }}

广告 广告

评论区