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/create.md at master · AvidCoder101/javascript

Expand file tree

/

create.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
33 lines (25 loc) · 574 Bytes
/

create.md

Copy path

File metadata and controls

33 lines (25 loc) · 574 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

Creation

Creating a number is easy, it can be done just like for any other variable type using the var keyword.

Numbers can be created from a constant value:

// This is a float:
var a = 1.2;

// This is an integer:
var b = 10;

Or from the value of another variable:

var a = 2;
var b = a;

{% exercise %} Create a variable x which equals 10 and create a variable y which equals a. {% initial %} var a = 11; {% solution %} var a = 11;

var x = 10; var y = a; {% validation %} assert(x === 10 && y === a); {% endexercise %}

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.