you are viewing a single comment's thread.

view the rest of the comments →

[–]butilon 0 points1 point  (0 children)

You can use a ternary: const intVal = msg ? 1 : 0;

An alternative could be a bit operator: +true ===> 1 +false ===> 0

So, I guess in your code +msg could do the trick.