JavaScript Variable coercion/conversion Converting a number to a string

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

String(0) === '0'

String(0) will convert the number (0) into a string ('0').

A shorter, but less clear, form:

'' + 0 === '0'


Got any JavaScript Question?