Expected an assignment or function call and instead saw an expression no-unused-expressions

Hyunwoo Seo·2022년 6월 15일
0

ErrorCode

목록 보기
5/16
post-thumbnail
Line 8:9:  Expected an assignment or function call and instead saw an expression  no-unused-expressions

Search for the keywords to learn more about each error

에러의 발생 원인은 map() 메서드를 사용할때 주의점과 동일하다.

.map(()=>{ }) 메서드를 중괄호와 같이 사용할때는 { } 중괄호 안에 return이 존재해야 한다.

  • .map() 메서드에서 { } 중괄호를 사용할때 return 을 사용한다.
  • .map() 메서드를 사용할때 요소를 ( ) 소괄호를 사용해서 묶어준다.

0개의 댓글