Javascript implode
Joins array elements placing glue string between items and return one string
Example 1
Running
1.implode(' ', ['Kevin', 'van', 'Zonneveld']);
Could return
1.'Kevin van Zonneveld'
function implode( glue, pieces ) {
// Joins array elements placing glue string between items and return one string
//
// version: 812.316
// discuss at: http://phpjs.org/functions/implode
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: Waldo Malqui Silva
// * example 1: implode(' ', ['Kevin', 'van', 'Zonneveld']);
// * returns 1: 'Kevin van Zonneveld'
return ( ( pieces instanceof Array ) ? pieces.join ( glue ) : pieces );
}
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
-
-
|
|