-2

I have the following JavaScript object :

[{
  Name: "Ishan",
  Code: 1,
  Is_Intern: "Yes",
  DateOfJoining: "01/02/2022",
  Skills: ["VB, DOT.NET, Angular"],
  Status: "Working"
}]

How can I add an item to the skills array in this object?

I didn't find any particular article regarding this.

2
  • you can add in array by .push(). Commented Feb 15, 2022 at 6:56
  • But How ? This is not a simple Array this is an array inside of a JavaScript object. Commented Feb 15, 2022 at 6:59

1 Answer 1

-1

var data = [{
  Name: "Ishan",
  Code: 1,
  Is_Intern: "Yes",
  DateOfJoining: "01/02/2022",
  Skills: ["VB, DOT.NET, Angular"],
  Status: "Working"
}]
data[0].Skills.push("New Skill");
console.log(data);

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.