navigation
JavaScript

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

| | JavaScript

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