Toggle menu

helper.utilArrayToList(inputArray [, allowBlanks])

Converts a JavaScript array to a comma separated list of values as a string.

If the allowBlanks parameter is true empty values in the array will also be included in the list.

Executed

Client and server-side.

Arguments

ArgumentTypeDescription
inputArrayArray, requiredA JavaScript array of values
allowBlanksBoolean, optionalIf true, blank elements of the list will be included

Returns

An array.

Example

function (helper, defaultValue, currentValue) {
    var fruits = ["Banana", "Orange", "Apple", "Mango"];
    var theValue = helper.utilArrayToList(fruits);
    return theValue;
}

Returns

"Banana,Orange,Apple,Mango"

Last modified on March 06, 2020

Share this page

Facebook icon Twitter icon email icon

Print

print icon