GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitbookIO_javascript/strings/length.md at master · reactapi/GitbookIO_javascript

Expand file tree

/

length.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
24 lines (18 loc) · 505 Bytes
/

length.md

Copy path

File metadata and controls

24 lines (18 loc) · 505 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

Length

It's easy in Javascript to know how many characters are in string using the property .length.

// Just use the property .length
var size = "Our lovely string".length;

Note: Strings can not be subtracted, multiplied or divided.

{% exercise %} Store in the variable named size the length of str. {% initial %} var str = "Hello World";

var size = {% solution %} var str = "Hello World";

var size = str.length; {% validation %} assert(size === str.length); {% endexercise %}

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.