Front-end basic-javascript third day

Source: Internet
Author: User

Arrays Array declaring an array

Working with Arrays

method used : array name [ index value ]; the name of the function ();

The index number starts at 0. 0 1 2 3 4 5 ...

The length of the array

array name . length;

Iterating through an array

think of the for traversal array

Characters connected

+

Add Value characters Connected

The value that all input takes is the character type.

Ternary operatorsThree mesh operator

One dollar: a++ b++ +a-a

two USD : A+b a>=b

ternary : an expression? Results 1: Results 2 equivalent to if Else

If an expression result is true , The return Results 1

If the result of an expression is false, returns the result 2

if (3>5) {alert ("one")} else {alert (22)} = =

3>5? Alert (one): Alert (22)

Exclusive ideas

Exclusive thought :

First, kill everyone . left me alone .

Front-end basic-javascript third day

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.