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 — javascript/strings/length.md at master · lizTheDeveloper/javascript

Expand file tree

/

length.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
33 lines (21 loc) · 471 Bytes
/

length.md

Copy path

File metadata and controls

33 lines (21 loc) · 471 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 substracted, multiplied or divided.


Store in the variable named size the length of str.

var str = "Hello World";

var size =
var str = "Hello World";

var size = str.length;
assert(size === str.length);

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.