es7新特性 Array.prototype.includes 用来检测 数组中是否包含某个元素 返回 布尔型值 ** 进行幂运算 // Math.pow(2,2) 效果一样

  // 1  Array.prototype.includes  用来检测 数组中是否包含某个元素 返回 布尔型值
    const mingzhu = ['西游记','红楼梦','三国演义','水浒传'];

    // 判断
    console.log(mingzhu.includes('西游记')); // true
    console.log(mingzhu.includes('金梅')); // false

    // ** 进行幂运算  // Math.pow(2,2) 效果一样
    console.log(2 ** 2);  // 4
    console.log(2 ** 3);  // 8
    console.log(2 ** 4);  // 16
posted @ 2021-05-19 21:33  13522679763-任国强  阅读(86)  评论(0)    收藏  举报