creamy-rocket-65969
11/06/2022, 12:58 AMgrowthbook.isOn()
never returns true on the Javascript sdk. What am I doing wrong?{
"status": 200,
"features": {
"alas": {
"defaultValue": true
},
"bar": {
"defaultValue": "foo"
},
"lorem": {
"defaultValue": true
}
},
"dateUpdated": "2022-11-06T00:34:37.739Z"
}
In browser console, I’m not seeing lorem
enabled:
if (growthbook.isOn("lorem")) {
console.log("Lorem is on")
} else {
console.log("Lorem is off")
}
Lorem is off
future-teacher-7046
setFeatures
asynchronously, so it's not available immediately. If you wait until after that to call growthbook.isOn
it should work.