Copy code code as follows:
var ForEach = (function () {
Traversal of arrays and pseudo arrays
var _array_foreach = function (Array, block, context) {
if (array = = null) return;
Special handling of String
if (typeof array = = '
CopyCode The Code is as follows: var foreach = (function (){
// Array and pseudo array Traversal
VaR _ array_foreach = function (array, block, context ){
If (array = NULL) return;
// Special processing of string
If (typeof array = 'string '){
Array =
No matter how you write a program, you will be exposed to the coding style, design patterns, and other concepts. The encoding style is generally focused on writing specifications, while the design pattern is biased towards programming architecture
Off TopicThis plug-in is more heavyweight .... With the familiarity of writing native JS efficiency to improve very much ... And, not only supports JS but also includes the Nodejs snippetJavascript-snippetsPlugin Author: ZenorochaGitHub Address:
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
1. variable definition// General statementVar a = 0;Var B = 1;Var c = 'xxx '; // Recommended statementVar a = 0,B = 1,C = 'xxx '; 2. Try to use the literal
// General statementVar obj = new Object ();Obj. a = 'a ';Obj. B = 'bb ';Obj. c = 'cc '; Var
No matter how you write a program, you will be exposed to the coding style, design patterns, and other concepts. The encoding style is generally focused on writing specifications, while the design pattern is biased towards programming architecture
I haven't updated it for a long time. Recently, my work has changed frequently and is still impetuous! It is not easy to engage in technology with peace of mind these years.
Now the company is relatively idle to sort out the previous Code public
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.