*New to Javascript
The code below is a section that changes the image source to the saved one.
Desired result: When there is no source for the image I want to display a ‘default.jpg’ image.
Perhaps, is there another way to write this logic out as a simple(r) condition?
Attempt
set_image({
image_data_url: items.image_data_url ?? "",
image_filename: items.image_filename ?? image.src = './assets/default.jpg',
});
Current
set_image({
image_data_url: items.image_data_url ?? "",
image_filename: items.image_filename ?? "No Image",
});