Values, variables, and literals

  • Revision slug: JavaScript/Guide/Values,_variables,_and_literals
  • Revision title: Values, variables, and literals
  • Revision id: 374019
  • Created:
  • Creator: Norbert
  • Is current revision? No
  • Comment Brought description of Unicode into the 21st century.

Revision Content

This chapter discusses values that JavaScript recognizes and describes the fundamental building blocks of JavaScript expressions: variables, constants, and literals.

Values

JavaScript recognizes the following types of values:

 
Type Examples of typed values / Notes
Numbers 42, 3.14159
Logical (Boolean) true / false
Strings "Howdy", "你好", "

Revision Source

<p>This chapter discusses values that JavaScript recognizes and describes the fundamental building blocks of JavaScript expressions: variables, constants, and literals.</p>
<h2 id="Values">Values</h2>
<p>JavaScript recognizes the following types of values:</p>
<table>
  <caption>
    &nbsp;</caption>
  <thead>
    <tr>
      <th scope="col">Type</th>
      <th scope="col">Examples of typed values / Notes</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Number" style="color: rgb(34, 85, 170); text-decoration: underline; line-height: 21px; " title="en-US/docs/JavaScript/Reference/Global Objects/Number">Numbers</a></td>
      <td>42, 3.14159</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" style="color: rgb(34, 85, 170); text-decoration: underline; line-height: 21px; " title="en-US/docs/JavaScript/Reference/Global Objects/Boolean">Logical (Boolean)</a></td>
      <td>true / false</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/JavaScript/Reference/Global_Objects/String" style="color: rgb(34, 85, 170); text-decoration: underline; line-height: 21px; " title="en-US/docs/JavaScript/Reference/Global Objects/String">Strings</a></td>
      <td>"Howdy", "你好", "
Revert to this revision