I've got an object returned from a field msg
which is an object. I'm attempted to get the value from msg and convert it into a string so I can use .startswith()
. I'm trying the following..
var msgstring = msg.value
if(msgstring.startsWith("string")){
//Doing stuff!
}
However, I get the following error...
Uncaught TypeError: Object string here has no method 'startsWith'
Where am I going wrong?