I like lookup tables:
if ({finished:1, uploading:1}[Progress.bar.status]){
//code here
}
this uses an object to code two or more options, and even side-steps quoting every choice. its also very fast since the object can be cached and there is no comparison logic or methods to invoke, just fast property access driving the flow...
do note that in some cases, you might want to use Object.create(null)
and then merge/extend that blank object with your options, if you absolutely must avoid false-positives for "hasOwnProperty", "valueOf", "toString", "toLocaleString", "constructor", and a few double-underscore extensions. it's not often an issue, but it is something to keep in mind. if you can live without feeding your if
those keywords, or building a cached collection of choices from Object.create(), it's a fast and simple way to code "one of the above" flows.