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/numbers/advanced.md at master · xfactorxtra/javascript

Expand file tree

/

advanced.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
35 lines (23 loc) · 554 Bytes
/

advanced.md

Copy path

File metadata and controls

35 lines (23 loc) · 554 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

Advanced Operators

Some advanced operators can be used, such as:

  • Modulus (division remainder): x = y % 2
  • Increment: Given a = 5
    • c = a++, Results: c = 5 and a = 6
    • c = ++a, Results: c = 6 and a = 6
  • Decrement: Given a = 5
    • c = a--, Results: c = 5 and a = 4
    • c = --a, Results: c = 4 and a = 4

Define a variable c as the modulus of the decremented value of x by 3.

var x = 10;

var c =
var x = 10;

var c = (--x) % 3;
assert(c === 0);

You are visitor 01402792 — 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.