size string js code example Example: string size javascript Click to copyvar str = "Hello World!"; var n = str.length; // n == 12