What is the difference between quotes and backticks?

Hi,

I am just curious why the following part:

if (inStock) {
resolve(Thank you. Your order was successful.);
} else {
reject(We're sorry. Your order could not be completed because some items are sold out.);

uses the floatation marks under the escape button (it won’t post them in this post I have noticed) instead of ‘’ or " " ? Thanks for the help!

1 Like

Do you mean the backtick marks? (``)

I don’t think there is any particular reason they were used here. Using regular quotation marks would work just as well.

One thing you can use backticks for, though, is to create template literals.


By the way, the reason the backticks aren’t showing up in your post is because they are used for special formatting on these forums. If you notice, your “Thank you” and “We’re sorry” messages are in a special font. That’s because surrounding text with backticks treats the text as code.