NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
# Else There is also an `else` clause that will be applied when the first condition isn鈥檛 true. This is very powerful if you want to react to any value, but single out one in particular for special treatment: ~~~ var umbrellaMandatory; if(country === 'England'){ umbrellaMandatory = true; } else { umbrellaMandatory = false; } ~~~ The `else` clause can be joined with another `if`. Lets remake the example from the previous article: ~~~ if(country === 'England') { ... } else if(country === 'France') { ... } else if(country === 'Germany') { ... } ~~~ Exercise Fill up the value of `name` to validate the `else` condition. ~~~ var name = if (name === "John") { } else if (name === "Aaron") { // Valid this condition } ~~~