15 1 0 4000 1 https://codeblock.co.za 300 true 0

str.length

0 Comments

Programming Language

JavaScript [Version: ECMAScript (ECMA-262)]

Syntax

Typical Usage

Gets the length of a string in JavaScript.


Return Value(s)

Returns the string length as an integer.

Notes

You cannot assign values to string.length. For example, string.length = 9 has no effect.

Examples of str.length

Example 1

var string = 'Codeblock';
console.log(string.length);

The above will log 9 to the console, which is the length of the word ‘Codeblock’.

Similar Functions in Other Languages

Was This Helpful?

Previous Post
console.log()
Next Post
array.join()

0 Comments

Leave a Reply