TAILIEUCHUNG - Học JavaScript qua ví dụ part 7

Xây Dựng: Các loại dữ liệu, các chữ, và biến Các loại dữ liệu Một chương trình có thể làm nhiều thứ, bao gồm cả tính toán, phân loại, tên, chuẩn bị danh sách điện thoại, hiển thị hình ảnh, xác nhận các hình thức, quảng cáo vô cùng tận. Nhưng để làm bất cứ điều gì, chương trình làm việc với các dữ liệu được trao cho nó. Các kiểu dữ liệu xác định loại dữ liệu, chẳng hạn như số và ký tự, có thể được lưu trữ và thao tác trong một chương trình | chapter 3 The Building Blocks Data Types Literals and Variables Data Types A program can do many things including calculations sorting names preparing phone lists displaying images validating forms ad infinitum. But to do anything the program works with the data that is given to it. Data types specify what kind of data such as numbers and characters can be stored and manipulated within a program. JavaScript supports a number of fundamental data types. These types can be broken down into two categories primitive data types and composite data types. Primitive Data Types Primitive data types are the simplest building blocks of a program. They are types that can be assigned a single literal value such as the number or a string of characters such as hello . JavaScript supports three core or basic data types numeric string Boolean In addition to the three core data types there are two other special types that consist of a single value null undefined Numeric Literals. JavaScript supports both integers and floating-point numbers. Integers are whole numbers and do not contain a decimal point such as 123 and -6. Integers can be expressed in decimal base 10 octal base 8 and hexadecimal base 16 and are either positive or negative values. See Example . 53 From the Library of 54 Chapter 3 The Building Blocks Data Types Literals and Variables Floating-point numbers are fractional numbers such as or . They must contain a decimal point or an exponent specifier such as . The letter e for exponent notation can be either uppercase or lowercase. JavaScript numbers can be very large . 10308 or 10-308 . EXAMPLE 12345 integer float .234E-2 scientific notation .234e 3 scientific notation 0x456fff hexadecimal 0X456FFF hexadecimal 0777 octal String Literals and Quoting. String literals are rows of characters enclosed in either double or single The quotes must be matched. If the string starts with a single quote it must end

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.