Closed Felixmurithi closed 10 months ago
Pug v 2.0.3
Node v20.9.0
section.section-reviews .reviews each review, i in tour.reviews // - console.log(review) +reviewCard(review)
mixin reviewCard(review) - console.log(review) - const rating= review.rating - const [reviewer]= review.user .reviews__card .reviews__avatar img.reviews__avatar-img(src=`/img/users/${reviewer.photo}` alt=`${reviewer.name}`) h6.reviews__user= reviewer.name p.reviews__text Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque dignissimos sint quo commodi corrupti accusantium veniam saepe numquam. .reviews__rating each star in [1,2, 3, 4, 5] svg.reviews__star(class= `reviews__star--${review.rating>= start? 'active': 'inactive'}`) use(xlink:href='/img/icons.svg#icon-star')
Pug error - const rating= review.rating - outputs all the reviews from tour.reviews however, - const [reviewer]= review.user does output only 1 user
- const rating= review.rating
tour.reviews
- const [reviewer]= review.user
Pug v 2.0.3
Node v20.9.0
Input Pug
reviewCard from
Pug error
- const rating= review.rating
- outputs all the reviews fromtour.reviews
however,- const [reviewer]= review.user
does output only 1 user