zoukankan      html  css  js  c++  java
  • JS数组常用方法---17、Array.of()方法

    JS数组常用方法---17、Array.of()方法

    一、总结

    一句话总结:

    Array.of()方法的作用是将一组值转变为数组,参数是要转换成数组的值,返回值是新的数组实例
    Array.of()
    作用:将一组值转变为数组
    参数:要转换成数组的值,elementN
    返回值:新的数组实例
    
    
    let arr=Array.of(1,3,'123',true);
    console.log(arr);//[1, 3, "123", true]

    二、Array.of()方法

    博客对应课程的视频位置:

     1 <!DOCTYPE html>
     2 <html lang="en">
     3 <head>
     4     <meta charset="UTF-8">
     5     <title>Array.of()方法</title>
     6 </head>
     7 <body>
     8 <!--
     9 Array.of()方法的作用是将一组值转变为数组,参数是要转换成数组的值,返回值是新的数组实例
    10 
    11 Array.of()
    12 作用:将一组值转变为数组
    13 参数:要转换成数组的值,elementN
    14 返回值:新的数组实例
    15 
    16 -->
    17 <script>
    18     let arr=Array.of(1,3,'123',true);
    19     console.log(arr);//[1, 3, "123", true]
    20 </script>
    21 </body>
    22 </html>
     
  • 相关阅读:
    jsp九大内置对象和4个域对象
    小甜点
    response编码
    request请求编码处理
    防盗链模拟
    request浏览器判断
    request获取ip
    ServletConfig
    HttpServlet原理
    Servlet,GenericServlet,httpServlet区别
  • 原文地址:https://www.cnblogs.com/Renyi-Fan/p/12683557.html
Copyright © 2011-2022 走看看