7.number && Data conversion to number typeInitializationvar number = new Number (' 23 ');//Use the constructor to create * use the TypeOf operator to return ' object '; Use the type function to return ' number ';var number = 23; Direct
5%10=5
x= "5" + "5";
x= "5" +5;
document.write (x);(results are:55)
Undefined is the value of an uninitialized variable, without a reference value, which is undefined
var anyway; Anyway is defined to have a null value
Unary operator:delete (delete
Introduction to JavaScriptJavaScript is a dynamic, weakly-typed, interpreted programming language that enhances page dynamics and enables real-time dynamic interaction between pages and users.JavaScript is made up of three parts: ECMAScript, DOM,
As a Java developer, because the actual need to start contact with C + + Recently, this is a recent contact with C + + some of the difficulties and error points, organized as follows, for themselves and other C + + BeginnersThrough this article, you
three ways to use JS1. Directly in the HTML tag, using the event properties, invoke the JS code: Point me! 2. From anywhere on the page, use the script tag3. External: Use the script tag src attribute to select an external address, type attribute
First, classificationBasic data type: Undefined, null, string, Boolean, numberComplex data type: ObjectThe properties of object are defined in the form of unordered name and value pairs (name:value)Second, detailed1, undefined:undefined type has
1:javascirpt are strictly case-sensitive.2:javascript (identifier) naming rules: The first character must be a letter, underscore, dollar sign, and other characters can be letters, underscores, dollar signs, or numbersThe 3:ecmascript identifier is
JS has 3 functions to convert non-numeric values into values: Number (), parseint (), and parsefloat ().Number () can be used for any data type, while the other two functions are specifically used to convert a string to a numeric value. These three
JS Basic syntax
is case-sensitive in JS.
Identifiers: Refers to variables, arrays, functions and other names. Defining the identity is actually the process of naming the word.
Hard requirements: means must be satisfied, otherwise
JavaScript introduces the history of JavaScript
1992 Nombas developed the embedded scripting language for C-minus-minus (c--), which was originally bound to Cenvi software, and renamed it Scriptease (the language that the client executes).
One: Number ()
If this is a Boolean value, True and false values are converted to 1 and 0, respectively.
If it is a numeric value, just simple incoming and return.
If it is a null value, returns 0.
If it is undefined, return nan.
If it is a
JS has 5 basic data types and 3 reference types, five basic data types are number, String, Boolean, Undefined, Null, complex data types are mainly object, Function, Array.typeof operatorBecause the js variables in are loosely typed , it provides a
In JS, there are three main types of detection objects, typeof,instanceof,constructor, which can detect the type of objects, but there are some differences.1 use typeof to detect object types.Typeo, as the most commonly used method of detecting
The three ways in which JS strings are converted into numbers are mainlyConversion function, coercion type conversion, using JS variable weak type conversion.1. Conversion function:JS provides two conversion functions for parseint () and parsefloat (
1. Variables Omitting the var operator in a local scope can define a global variable, but doing so can cause the variable to be difficult to maintain, and in strict mode causes a Referenceerror error to be thrown.2. Data type (JS Common 6 data
JS data type conversion method mainly has three kinds ofConversion function, coercion type conversion, using JS variable weak type conversion.1. Conversion function:JS provides two conversion functions for parseint () and parsefloat (). The former
Part I: Data typesJavaScript data types are typically 6 (ES6 new seventh Symbol type)Number: valueString: StringsBoolean: Boolean type, True or Falseundefined: No value assignednull: null, value is "none" stateObject: ObjectsUsually
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.