mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-26 03:02:39 -05:00
447 B
447 B
title, localeTitle
| title | localeTitle |
|---|---|
| Find the Length of a String | Encontre o comprimento de uma string |
Encontre o comprimento de uma string
As cordas têm um atributo (recurso) chamado 'comprimento'. Tudo o que você precisa fazer é marcá-lo após a string / variável.
var str1 = "Hello";
var length1 = str1.length; // This returns 5
var length2 = " Camper".length; // This returns 7 because the space is counted as one character.