DEV Community

Grace Do
Grace Do

Posted on

String interpolation

In JavaScript, string interpolation must be enclosed in the backticks:

`The count is ${num}`
Enter fullscreen mode Exit fullscreen mode

In Ruby, string interpolation is written as a normal string, with single or double quotes:

"The count is #{num}"
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
heratyian profile image
Ian

Hi Grace. Good insight. In Ruby, I believe you have to use double quotes for string interpolation.

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup 🚀

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

👋 Kindness is contagious

If you found this article helpful, please give a ❤️ or share a friendly comment!

Got it