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
라는 에러메세지도 같이 뜹니다.