{
"tin": "TIN is required",
"bic": "BIC is required",
}
I need to put all the property values of an object into an array.
{
"tin": ["TIN is required"],
"bic": ["BIC is required"],
}
How to do it?
{
"tin": "TIN is required",
"bic": "BIC is required",
}
I need to put all the property values of an object into an array.
{
"tin": ["TIN is required"],
"bic": ["BIC is required"],
}
How to do it?
2
Answers
Object.entries()
gives you an array of key value pairsUpdate due to comment:
You can simply use
Object.keys(yourobject)
: