Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Publication Station
Search
Editing
Javascript
(section)
From Publication Station
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=Data types = '''Code pen exampled: https://codepen.io/PublicationStation/pen/wmjXLR''' JS features a few data types, or in other words different types of content, which can be used as values of a variable. These include: * [https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/Strings strings]: pieces of text, always wrapped in single or double quotation marks <code>var name = "I am Pluto";</code> * [https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/Math numbers] (both integers and float point numbers) <code>var discovered = 1930;</code> * booleans: true or false values (outside quotation mais) <code>var planet = false; var dwarf=true;</code> * [https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/Arrays Arrays] (or lists): a container of multiple values enclosed in square brackets and separated by commas <code>var planets=["Pluto", "Neptune", "Uranus", "Saturn"]</code> ** the values of arrays can be accessed by their location within the array var <code>p=planets[0]; var s=planets[3]</code> * Object: is a list of items, each item, stored by a name-value pair. The values can be strings, numbers, lists or even other objects. ** <code>var saturn = {"moons": ["Pan", "Daphnis", " Atlas", "Prometheus", "Pandora"], "Volume":"95.159 Earths"}</code>
Summary:
Please note that all contributions to Publication Station are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Publication Station:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Main navigation
Main page
Printmaking Studio
Print Studio
Dig. Publishing Studio
Namespaces
Grafiwiki
Random Page
Log in
Wiki tools
Wiki tools
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs