-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconcat.js
36 lines (32 loc) · 1.25 KB
/
concat.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"use strict";
// TOPIC /////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Array Method: .concat()
//
// SYNTAX ////////////////////////////////////////////////////////////////////////////////////////////////////
//
// string.concat(string2, string3, string4, ...)
//
// SUMMARY ///////////////////////////////////////////////////////////////////////////////////////////////////
//
// • .concat() methods concatenates the provided string arguments to the calling string and returns a new string
// •
//
// EXAMPLES //////////////////////////////////////////////////////////////////////////////////////////////////
//
// EXAMPLE 1: Concatenate a new string
//
// RESOURCES /////////////////////////////////////////////////////////////////////////////////////////////////
//
//
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// EXAMPLE 1: Concatenate a new string from other provided strings.
let greeting = "Hello";
let name = "Joe";
let excitement = "!";
function concatIt(str1, str2, str3) {
const concatString = str1.concat(str2, str3);
console.log(concatString);
}
concatIt(greeting, name, excitement); // HelloJoe!