I have an array of object ,wanted to check the key "PhysicalVirtual" has same value in all objects.
if it has same value, should return true else it should return false.
code which I have tried:
var testArray=[{
"Hostname": "NDCWCAP03",
"PhysicalVirtual": "P",
"Tier1": null,
"Tier3": null,
}, {
"Hostname": "NDCWCAP05",
"PhysicalVirtual": "P",
"Tier1": null,
"Tier3": null,
}];
gs.info(testArray.find(key => key.PhysicalVirtual === 'P'));
Error: getting syntax error here
Evaluator: com.glide.script.RhinoEcmaError: syntax error
script : Line(13) column(30)
console.log(testArray.find(key => key.PhysicalVirtual === 'P'));