JS: Apostrophe Delimiter String

By Xah Lee. Date: .

APOSTROPHE Delimiter

APOSTROPHE Delimiter (U+27: APOSTROPHE) can also be used.

Use \' to embed a APOSTROPHE.

// APOSTROPHE quoted string

console.log('my cat');
// my cat

// with escape
console.log('john\'s cat');
// john's cat

Difference Between APOSTROPHE and QUOTATION MARK Quoted String

There's basically no difference, except that if you need to embed a APOSTROPHE or QUOTATION MARK , you need to escape it.

JavaScript. String