문제를 못풀어서 해답을 훔쳐봤습니다.
나름 천천히 해석하고 다시 해보고 있는중인데요.. 궁금한게 있습니다. 해답에 보면 appendProduct 라는 함수가 있는데.. 거기 nuwItem 이라는 변수를 만들고 거기에 태그를 넣는데요.. 백틱을 해서 적는 거는 이해가 되는데 왜 백틱 앞에 $( 표시를 하는지 모르겠습니다. $ 표시는 제이쿼리에 선택자라는 표시가 아닌가요? 궁금합니다.
function appendProduct(product, index) {
var newItem = $(`
<div class="card col-4 p-0" data-index="${index}">
<img src="resources/images/${product.photo}" class="card-img-top" alt="${product.product_name}" title="${product.product_name}">
<div class="card-body">
<h5 class="card-title product-name">${product.product_name}</h5>
<p class="card-text brand-name">${product.brand_name}</p>
</div>
<div class="card-footer">
<small class="text-muted price">${product.price}</small>
</div>
</div>
`).draggable({
zIndex: 999,
revert: "invalid",
});
$("#product-list").append(newItem);
}