javascript - Joining property values of objects in an array -


I have an array of objects in objects that have a property called 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 (",");   

Is there a way to do this in a line of code?

map for for And leave brackets and curly braces in the lambda:

var user name = object error.map (o = & gt; o.userName). Include (',');

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -