커뮤니티
포인트
로딩중
쿠폰
내 강의실
국비 신청 내역
수강권
증명서
숙제 피드백
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
3-3
웹개발 종합반
3주차
북마크
김*경
댓글
2
추천
0
조회수
8
조회수
8
답변 완료
function listing() {
    $.ajax({
        type: "GET",
        url: "http://spartacodingclub.shop/post",
        data: {},
        success: function (response) {
            let rows = response['articles']
            for (let i = 0; i < rows.length; i++)
                let comment= rows[i]['comment']
                let desc = rows[i]['desc']
                let image = rows[i]['image']
                let title = rows[i]['title']
                let url = rows[i]['url']
                console.log(comment, desc, image, title, url)



여기까지 진행을 했는데 comment 를 변수로 선언해서 console.log 하려고 보니

계속 밑줄에 let comment 에 활성화가 안되어있네요ㅠ? 변수 선언이 안된건가요?


콘솔 확인 시

Uncaught SyntaxError: Lexical declaration cannot appear in a single-statement context

라는 에러메세지도 같이 뜹니다.

취소
 공유
취소
댓글 0
댓글 알림
나의얼굴