Added switch statements in JavaScript