mathOp = function(type){
return (
"add" == type? function(a,b){return a + b}
:"mul" == type? function(a,b){return a * b}
:"sub" == type? function(a,b){return a - b}
:"div" == type? function(a,b){return a / b}
)
}
Инструмент отладчика Chrome JS сообщает: SyntaxError: Unexpected token )
Что не так с этим синтаксисом?
switch
илиif/ else
. - person Matt   schedule 15.05.2012