JavaScript Length() Function Example

JavaScript length() function return the string length value of given string character.

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <title>JavaScript str length function</title>
</head>
<body>
  <script type="text/javascript">
    var str = "Hello String!";
    document.write('Length of the given String: ' + str.length);
  </script>
</body>
</html>

Run it...   »

Example Result