javascript - Joining property values of objects in an array -
I have an array of objects in objects that have a property called Is there a way to do this in a line of code? userName whether a comma delimited Adding the userName value to the string? I think I can use the join function, but the only way I can think of two steps.
var Username: string []; ObjectArr.forEach ((o) => {userNames.push (o.userName);}); Var UsernameJonded = Username.Join (",");
map for for And leave brackets and curly braces in the lambda: var user name = object error.map (o = & gt; o.userName). Include (',');
Comments
Post a Comment