JavaScript

How to find the length of the string variable in JavaScript?

How to find the length of the string variable in JavaScript?, someone asked me to explain?

In this article we will discuss how to length of the string variable in JavaScript using length property.

<script type="text/javascript">

    alert("iam a alert".length);

</script>

Output:

length of string

 <script type="text/javascript">

    var myString = ".net tutorial site";

    alert(myString.length);

  </script>

Output:

 

length of string

Post your comments / questions