Reputation: 4031
How can I create an object like this in JS since public and private are reserved words
keyObject = {
public : {
iv: "123",
key: "123"
},
private : {
key: "123"
}
}
Upvotes: 0
Views: 66
Reputation: 36965
Quote the keys, like this:
var keyObject = {
"public" : {
iv: "123",
key: "123"
},
"private" : {
key: "123"
}
}
Upvotes: 1
Reputation: 625
you can define keys as strings
keyObject {
'public': {
iv: "123",
key: "123"
},
'private': {
key: "123"
}
}
Upvotes: 0