数组内容的错误

function f4()
            {
                var arr=[a,2,3];
                arr.forEach(function(element,i){show(element);});
                
            }
function f5()
            {
                var arr=["a",2,3];
                arr.forEach(function(element,i){show(element);});
                
            }
数组内容

函数f4的数组第一个元素a,没有声明过,导致错误;

字母a应该写作"a".

posted on 2014-04-20 03:38  13m0n  阅读(122)  评论(0编辑  收藏  举报