Coladeu
Coladeu

Reputation: 13

Append value without attribute to json javascript

I have this json

["ESp", "lBe", "IBp"]

and i want to append "abc" to it so it can look like this:

 ["ESp", "lBe", "IBp", "abc"]

I have tried some methods but all of them add attributes and i don't want attributes , only values. Thanks

Upvotes: 1

Views: 32

Answers (1)

millerbr
millerbr

Reputation: 2961

Unless there is more to your array than I can see, this should work:

var myList = ["ESp", "lBe", "IBp"];
myList.push("abc");

Upvotes: 3

Related Questions