배열을 푸시 할 수있는 기능이 있지만 문제가 발생하는 이유는 항상 조건이 함께 점검되기 때문입니다. 이걸 제외하고, 곱슬 머리를 사용하면 배열 번호가 생성됩니다. 시대의. 심지어 내가 제대로 여기에 설명 할 수없는, 내 코드를 봐 :jquery가 조건부 일 경우
$.map(pObj,function(values,i){
if(typeof pieArray[values.GeoID] == 'undefined')
pieArray[values.GeoID] = []; //it should create only one time
pieArray[values.GeoID].push(values.ResponsePercentage); // when it matches it should not go down to check next if. else it can go.
if(!values.GeoID && typeof pieArray[0] == 'undefined')
pieArray[0] = []; //it should create only one time
pieArray[0].push(values.ResponsePercentage); //now the top if get response, till it is checking and throwing error. top if not match, then it need to work.
});
나는 이것을 어떻게 할 수 있습니까?
제발 모욕으로 생각하지 마십시오. 영어 원어민이 아니며 형식이 잘못된 질문과 문법 사이에서 당신이 말하는 것을 이해하려고 힘듭니다. 다시 설명하거나 더 많은 코드를 제공 할 수 있습니까? – RASG
죄송합니다. 몇 가지 해결 방법이 있는데 문제가 해결되었습니다. 감사. – 3gwebtrain