To perform a character count in JavaScript, use the following syntax:

var str = "Hello World!";

var n = str.length;

BY Best Interview Question ON 25 Aug 2022