typeof operatorReturns a string that is used to represent the data type of an expression.
typeof[() expression[]];
The expression parameter is any expression that needs to find the type information.
DescriptionThe typeof operator returns the type
All programming languages have internal (or built-in) objects to create the basic functions of the language. An internal object is the language used to write Custom Code. The Code implements custom functions based on your imagination. JavaScript has
1.NumberJavaScript has only one numeric type, can have decimals or not, and can use scientific notation.var y=123e5; // 12300000 var z=123e-5; // 0.00123JavaScript is not a type language. Unlike many other programming languages, JavaScript does
A Boolean (logical) object is used to convert non-logical values to logical values (true or false). The following describes the initial values of a Boolean object in javascript: Boolean (logical) the object is used to convert non-logical values to
JavaScript is a weak type or dynamic language. This means that you do not need to declare the variable type in advance. During the program running, the type will be automatically determined. This also means that you can use the same variable to save
JavaScript is a weak type , or dynamic language. This means that you do not have to declare the type of the variable in advance, and the type is automatically determined during the program's run. This also means that you can use the same variable to
Html
Xmlns
= "Http://www.w3.org/1999/xhtml"
>
Head
>
Title
>
Title
>
Script
Type
= "Text/JavaScript"
>
Function
Show (){
//
If typeof is followed by a parameter, a string of the parameter type is
A tour of Javascript Data Types
Although Javascript is a weak type language, it also has several data types, including Number, String, Boolean, Object, Udefined, and Null. Objects are complex data types, and they are composed of unordered key-value
11, HTML element event attributes, such as onclick= "", double quotation marks can be a method bar, can be JS code (no add Call StartTime () in onload18. JavaScript Array (Array) object:There are three ways to create an array.1: Conventional way:var
Instanceof and typeof in JavaScript are often used to determine what type of variable is (an instance), but their use is different:
typeof operatorReturns a string that is used to represent the data type of an expression.
typeof expression;
The
The Boolean object is similar to the Boolean package class in Java, and it has two values: True and False
1. Create a Boolean object
Copy Code code as follows:
var boo = new Boolean ()//The Boo is not assigned at this time, but its
/**
* in almost all languages | | and && Follow the principle of "short-circuit",
* If the first expression in && is false, it will not handle the second expression, and | | Just the opposite.
* JS also follow the above principles.
* When | |
Js uses the typeof Method to Determine the undefined type, typeofundefined
Js determines the undefined type
if (reValue== undefined){alert("undefined");}
The system found that the data could not be determined, and finally found the information to
Array is used in js. For example, if multiple inputs with the same name are dynamically generated, You need to determine whether the input is an array. if (document. mylist. length! = "Undefined") {} This usage is incorrect.
Correct is if (typeof
Description of Boolean Type in JavaScript systems, javascriptboolean
Previous
The Boolean type can be the simplest of the three packaging objects: Number, String, and Boolean. Number and String objects have a large Number of instance attributes and
Fully parse the valueOf and toString methods in JavaScript (recommended), and fully parse the valueof
In this case, all JS data types have the valueOf and toString methods, except null. They solve the javascript value calculation and display
13.1.1 run JavaScript
We have already introduced that JavaScript is usually embedded in an interconnected web page for execution. There are two ways to embed and execute JavaScript code in an HTML page.
Use javascript: prefix to construct the URL
Weekend a bit lazy, ran to see "Outsmart Tiger Mountain", Hand tore the Devil's God Plot Festival by Xu Lao Strange a memory line to explain the past, the cow to the acme of this four-and-a-kind handling method, hand tear plus points, four stars
Use the typeof Method to Determine the undefined type, typeofundefined
For JavaScript to determine the undefined type, the typeof method is used. typeof returns a string, where one is undefined.
Js determines the undefined type
if (reValue==
Determination of variable types in javascript
In JavaScript, there are 5 basic data types and 1 complex data type. The basic data types include:Undefined,Null,Boolean,NumberAndString; The complex data type isObject,ObjectIt also subdivided into
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.