Unit 7.2. JavaScript Syntax

Variables, Literals, and Value Types

Value (Data) Types

The value types in JavaScript are:

  • Numbers

  • Boolean—“true” or “false”

  • Strings

  • Null—keyword

  • Undefined—the value of an unassigned variable

JavaScript is a loosely typed language. The word “typed” here refers to the data type and not the keyboard habits of coders. Unlike languages such as PL/SQL, there is no need to declare a variable’s data type in JavaScript. Furthermore, the same variable can be used to store different data types. JavaScript automatically does the data conversion for you. In PL/SQL, a variable declared to be of data type Number can only hold a value of the data type Number. Not so in JavaScript. A variable can be assigned a Number data type value ...

Get Oracle® Web Application Programming for PL/SQL® Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.