首页 > 其他分享 >无涯教程-concat()函数

无涯教程-concat()函数

时间:2024-02-02 20:31:53浏览次数:19  
标签:教程 无涯 numeric alphaNumeric 数组 var alpha concat

concat()方法连接两个或更多的数组,并返回结果。

concat() - 语法

array.concat(value1, value2, ..., valueN);
  • valueN   -  要连接到输出数组的数组和/或值。

concat() - 返回值

返回一个新数组。

concat() - 示例

var alpha=["a", "b", "c"]; 
var numeric=[1, 2, 3];
var alphaNumeric=alpha.concat(numeric); 
console.log("alphaNumeric : " + alphaNumeric ); 

运行上面代码输出

alphaNumeric : a,b,c,1,2,3

参考链接

https://www.learnfk.com/es6/es6-array-method-concat.html

标签:教程,无涯,numeric,alphaNumeric,数组,var,alpha,concat
From: https://blog.51cto.com/u_14033984/9561962

相关文章

  • 无涯教程-String.prototype.includes(searchString, position = 0)函数
    该方法确定字符串是否是给定字符串的子字符串。String.prototype.includes-语法str.includes(searchString[,position])searchString-要搜索的子字符串。position    -该字符串中开始搜索searchString的位置;默认为0。String.prototype.includes-返回值t......
  • Angular 17+ 高级教程 – Angular Configuration (angular.json)
    前言记入一些基本的配置。 SetupIPAddress、SSL、Self-signedCertificate如果你对IPAddress、SSL、Self-signedCertification不熟悉,请看这篇先 VsCode,VisualStudio2022,AngularandLiveServerRunningThroughHttpsandIPAddress在angular.json添加设......
  • 无涯教程-String.prototype.startsWith(searchString, position = 0)函数
    该方法确定字符串是否以指定的字符开头。String.prototype.startsWith-语法str.startsWith(searchString[,position])searchString  - 在此字符串开头要搜索的字符。position     - 该字符串中开始搜索searchString的位置;默认为0。String.prototype.s......
  • 【幻兽帕鲁教程】一键配置游戏参数
    幻兽帕鲁部署完成之后,如果您想要按照自己的喜好来对游戏世界进行DIY,打造个性化的服务器,那么就需要通过配置游戏参数来完成。最近一段时间,这一步可谓是让众多玩家头疼不已,如何找到配置文件?如何配置死亡不掉落?如何设置游戏房间密码?由于直接编辑配置文件的成本较高,且可能会各种各样......
  • GCC使用具体教程以及例子
    编译第一个C程序#include<stdio.h>intmain(void){printf("helloworld!\n");return0;}使用gcc命令将hello.c编译成可执行程序a.out,并运行: 将源文件hello.c编译为一个指定名称的可执行文件:hello,可以通过gcc-o参数来完成GCC编译过程分析 以demo.c为......
  • GCC使用教程——GCC是什么?
    整理学习来自:https://www.xinbaoku.com/gcc/对于GCC的认知,很多读者还仅停留在“GCC是一个C语言编译器”的层面,是很片面的。从本节开始,我将带领大家系统学习GCC,本节先带领大家系统地了解一下GCC。谈到GCC,就不得不提GNU计划。GNU全称GNU'sNotUNIX,又被称为“革奴计划”,......
  • 无涯教程-toString()函数
    此方法返回表示指定对象的字符串。toString()-语法string.toString()toString()-返回值返回表示指定对象的字符串。toString()-示例varstr="Applesareround,andApplesareJuicy.";console.log(str.toString());运行上面代码输出Applesareround,an......
  • 【教程】Objective-C 性能监控
     1、内存监控CPU内存监控克魔助手提供了分析内存占用、查看CPU实时活动数据以及追踪特定应用程序的功能,让开发者可以更好地了解应用程序的运行情况。以下是一些示例截图: ​    ​   ​  同样,克魔助手还提供了内存、GPU性能监控、网络监控等功......
  • 无涯教程-toLowerCase()函数
    此方法返回转换为小写的调用字符串值。toLowerCase()-语法string.toLowerCase()toLowerCase()-返回值返回转换为小写的调用字符串值。toLowerCase()-示例varstr="Applesareround,andApplesareJuicy.";console.log(str.toLowerCase())运行上面代码输......
  • 无涯教程-substring()函数
    此方法返回String对象的子集。substring()-语法string.substring(indexA,[indexB])indexA   - 小于字符串长度的0到1之间的整数。indexB   - (可选)0到字符串长度之间的整数。substring()-返回值substring方法根据给定的参数返回新的子字符......