JS switch function type serialization escape

Source: Internet
Author: User
Tags setinterval

Switch (name) {
Case ' 1 ':
Age = 123;
Break
Case ' 2 ':
age = 456;
Break
Default:
Age = 777;
}

Function
function func (ARG) {

Return arg+1
}
var result = func (1)
Console.log (result);

Common functions:
function func () {

}
Anonymous functions:

function func (ARG) {

Return arg+1
}

SetInterval ("func ()", 5000);

SetInterval (function () {
Console.log (123);

},5000)

Self-executing functions (creating functions and automating them):
function func (ARG) {
Console.log (ARG);
}
Func (1)

(function (ARG) {
Console.log (ARG);
}) (1)
Serialization of
Json.stringify () Converts an object to a string
Json.parse () Converts a string to an object type

Escape
Client (Cookie) = "Server Side"
After the data has been escaped, it is saved in a cookie

JS switch function type serialization escape

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.