javascript coding bootcamp

Want to know javascript coding bootcamp? we have a huge selection of javascript coding bootcamp information on alibabacloud.com

"Learning Notes" JavaScript coding specification-type

Type Base type: The type value should be manipulated directly when accessing the base typeString number Boolean null undefinedvar a = 0; var b = A; b = 8; Console.log (b); 0,8Note:1. In JavaScript, call the console to write the log.2, open the IE Developer tool to use the console, the default access to IE Console object will be error.Composite type: When you access a composite type, you should manipulate its referenceObject Array functionvar a = [n]

JavaScript Coding Specification (1)

] Sometimes we use some special tags to illustrate. Special tokens must be in the form of a single-line comment. Some common tags are listed below: TODO: There are functions to be implemented. At this point, you need to make a brief description of the functionality that will be implemented. Fixme: The code is running fine, but it may need to be fixed due to time or other reasons. A brief description of how to fix it is required at this point. HACK: A code that is not well writte

JavaScript coding specification [original]

Topic:The variables and attributes in JS are different, for example, properties can be deleted using "delete", and variables defined by "Var" cannot.The same method is different from the function, a method of a class can be accessed externally and a function in a class cannot.var TestClass = function () { // externally accessible this . GetName = function () {} // external inaccessible function Getage () {}}; var New TestClass (); var // Normal var // ErrorAttach the JS specificat

The coding and decoding method of Javascript--uri

Valid URIs (Uniform Resource Identifiers) cannot contain certain characters, such as spaces, so they need to be encoded in the following ways: encodeURI () and encodeURIComponent (),The decoding methods of the coded codes are: decodeURI () and decodeURIComponent ().encodeURI () coding can only decodeURI () solutionencodeURIComponent () code can only decodeuricomponent () solution,encodeURI (): Used to encode a complete URI that does not encode special

JavaScript Coding Specification

global environment.Example:// Good var name = ' MyName '; // Bad = ' MyName ';2.2 Object Oriented[ mandatory ] Create objects using the constructor pattern and the prototype pattern combination. Example:function  Person (name, age) { this. Name = name; this. Age =function () { alert (this. name);}; var New Person (' Tom '); var New Person (' Greg ',);p erson1.sayname (); alert (person2.age);[ mandatory ] The inheritance of classes uses parasitic combined inheritance. Example:functionInh

JavaScript Coding Style

Indent inThe hierarchy of each row consists of 4 spaces Length of LineEach line is not more than 80 characters long. If a row exceeds 80 characters, wraps after an operator (comma, plus sign), and the next line increments by 2 indents Original valueAvoid using special value undefined to determine whether a variable is defined with the TypeOf operator CommentsA) an exclusive line of comments to explain the next line of code;B) a comment at the end of the code line to explain the code before

JavaScript Coding Specification Learning

The Conditional Judgment section in the while and if statements avoids the use of assignment statements. = = = and!== The decision equality uses the congruent notation (= = = and!==), avoiding the use of mandatory type equality conversion symbols (= = and! =). If a number plus (or-) a number with a sign (+ or-), or a number with (+ + or-), you need to enclose the number with the symbol or (+ + or-). Eval is the Devil (eval's abuse L) Eval

"Learning Notes" JavaScript coding specification-blank

Use tabs to set two (four) spaces, which are typically configurable in the IDE. Specific according to the actual requirements.Badfunction () {???? var name;} Badfunction () {? var name;} Goodfunction () {?? var name;}Leave a space in front of the left curly brace.Badfunction Test () {console.log (' Test ');} Goodfunction Test () {console.log (' Test ');} Baddog.set (' attr ', {age: ' 1 year ', Breed: ' Samoyed '});//Gooddog.set (' attr ', {age: ' 1 year ', Breed: ' Husky '});In the control state

"Notes" JavaScript Coding specification-type Assignment & coercion

Executes a coercion type conversion statement.StringBad use parseint to convert numbers and take a binary as a parametervar a= ' 4 ';//Badvar val = new number (a);//Badvar val = +a;//Badvar val = a>> 0;//Badvar val = parseint (a);//Goo DVar val = number (a);//Goodvar val = parseint (A, 10);for whatever reason, perhaps you have done something "rude", perhaps parseint has become your bottleneck, perhaps considering performance and the need to use bit arithmetic, use annotations to explain why you

Front End (HTML/CSS/JS)-javascript Coding specification

1. Variable naming (1) Variable names should not be proud of a short coincidenceThe variable name on the left is not very clear, the code extensibility is not good, once the code needs to add functionality, it is easy to appear obj1, Obj2, obj3 this very abstract naming method. So start by making the name of the variable really meaningful, and don't make a very short, generic name.(2) BOOL variableIt is not advisable to start with a Boolean variable like is/dovar true , true , false;Can

"Notes" JavaScript coding specification-accessors

For properties, accessor functions are not required.If accessor functions are defined, the Getval () and Setval (' Hi ') formats should be referenced.Baddragon.age ();//Gooddragon.getage ();//Baddragon.age (+);//Gooddragon.setage (25);If the property is Boolean, the format should be isval () or Hasval ().Badif (!dragon.age ()) {return false;} Goodif (!dragon.hasage ()) {return false;}a good idea to create a get () and set () function, but keep it consistentfunction Test (options) {Options | | (o

"Learning Notes" JavaScript coding specification-variables

Always declare a variable with VAR, or change it to a global variable. We have to find a way to avoid global space pollution.BADAAA = new AAA (),//goodvar AAA = new AAA ();//god bless!declaring each variable with VAR makes it easy to add a new variable declaration without worrying about a, replacing aBadvar items = GetItems (); Gosportsteam = true;d ragonball = ' z ';//goodvar items = GetItems (); var gosportsteam = true; var dragonball = ' Z ';//god bless!Assigning a value to a variable at a sc

"Learning Notes" JavaScript coding specification-strings

Use single quotation marks for strings.Goodvar name = ' Terence ';//badvar name = "Terence";Strings longer than 80 characters should be wrapped using a string connector.Goodvar msg = ' Test Information testing information Test information Test information ' + ' test information Test information Test Information Test Info Testing Information Test information ' + ' test information Test information testing information ';Badvar msg = ' Test information Test Info test Information Testing Information

"Learning Notes" JavaScript coding specification-functions

function expressionanonymous function var anonymous = function () {return true;};/ /named function var named = function named () {return true;} Iife functions immediately-invoked function Expression (function () { console.log (' hello! ');}) ();Do not declare functions in a function block (if while etc), although the browser allows you to assign a variable to a function, but different browsers may parse differently.ECMA-262 defines a block as a set of statements, but the function is not a state

"Learning Notes" JavaScript coding specification-declaring elevation

The variable declaration should be at the top of the scope, but the assignment is not.function Example () {var declaredbutassigned;//as output declaredbutnotassigned undefined Console.log (declaredbutnotassigned) Declaredbutnotassigned = true}Anonymous expressions can elevate their variable names, but they cannot raise function assignments.function Example () {console.log (anonymous);//undefined anonymous ();//Type error var anonymous = function () {console.log (' Anonymous function expression '

"Notes" JavaScript coding specification-constructors

Define the method on the prototype object instead of rewriting it with the new object. Overrides make inheritance impossible: Resetting the prototype overrides the entire base class.function Jedi () {console.log (' new Jedi ');} Badjedi.prototype = {Fight:function fight () {Console.log (' fighting ');},block:function block () {Console.log (' Blocking ');}};/ /goodJedi.prototype.fight = function fight () {Console.log (' fighting ');}; Jedi.prototype.block = function block () {console.log (' block

JavaScript coding specification (Chinese/Airbnb), javascriptair.pdf

JavaScript coding specification (Chinese/Airbnb), javascriptair.pdf Airbnb is a company located in San Francisco, USA. This article is its internal JavaScript code specification, which is well written. on Github, there are 16,686 + Star, 3,080 + fork, front-end developers can refer. Original article: https://github.com/airbnb/

JavaScript URL Chinese Character coding conversion

When using a URL for parameter passing, some Chinese name arguments or URL addresses are often passed, and conversion errors occur during background processing. In some pass-through pages use GB2312, and the Receive page uses UTF8, so that the received parameters may be inconsistent with the original. URLs that are encoded using the server-side UrlEncode function are not the same as the URLs encoded with the encodeURI function of client JavaScript. Hu

Basic JavaScript coding mode summary _ basic knowledge

The patterns I have compiled in this article include some common methods or tips when writing JavaScript code. They can help beginners in JavaScript to quickly improve the code quality. No matter how programs are written, they will be exposed to the encoding style, design Patterns and other concepts. The coding style generally focuses on writing standards, while

"Notes" JavaScript coding specification-JQuery

jquery object variable uses prefix $Badvar Sidebar = $ ('. Sidebar ');//Goodvar $sidebar = $ ('. Sidebar ');Caching jquery QueriesBadfunction Setsidebar () {$ ('. Sidebar '). Hide ();//. stuff...$ ('. Sidebar '). css ({' Background-color ': ' Pink '});} Goodfunction Setsidebar () {var $sidebar = $ ('. Sidebar '); $sidebar. Hide ();/. Stuff ... $sidebar. css ({' Background-color ': ' Pink '});Use the Cascade $ ('. Sidebar ul ') or parent-child $ ('. Sidebar > ul ') selector for DOM queries. JsPer

Total Pages: 4 1 2 3 4 Go to: Go

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.