Guarded `if` for JS