で複数の引数が存在することを確認する - すべての引数7が何かを行う前に、存在する場合は、私はこのような関数を持ってエレガントなやり方
var myFunction = function(arg1, arg2, arg3, arg4, arg5, arg6, arg7){
if(typeof arg1 != 'undefined' && typeof arg2 attributeId != 'undefined' && typeof arg3 != 'undefined'){ //and so on for all the arguments
//do something with all of the arguments
}
}
基本的に、私はチェックしています。
これは醜く見え、判読できません。あなたは同じことを達成するためのよりエレガントな方法を提案できますか?
@ JaredPar、あなたは私が編集するよりも速くコメントします。 – harpo