Standards and best practices guides for various front-end technologies.
Author:
Steve Kwan
[email protected]
http://www.stevekwan.com/
Originally from my GitHub:
https://github.com/stevekwan/best-practices/
JavaScript and CSS guidelines for pragmatists.
Standards and best practices guides for various front-end technologies.
Author:
Steve Kwan
[email protected]
http://www.stevekwan.com/
Originally from my GitHub:
https://github.com/stevekwan/best-practices/
In gotcha's you say the word "scope" a lot but never define it.
JavaScript scope is defined by functions. There is no block scope (ie. for loops, if else, etc.). Only function and global scope.
Its also worth talking about how primitives are passed by value and objects are passed by reference.
Also, your attitude toward JS makes me ๐ข
myFunction = function(arg1, arg2) {}; // NEVER do this!
function myFunction(arg1, arg2) {}; // This is OK, but...
var myFunction = function(arg1, arg2) {}; // This is best!
It should actually be
myFunction = function(arg1, arg2) {}; // NEVER do this!
function myFunction(arg1, arg2) {}; // This is OK, but...
var myFunction = function(arg1, arg2) {}; // This is good.
var myFunction = function myFunction(arg1, arg2) {}; // This is best!
which is much better for debugging purposes.
Under the functions section, with regards to this syntax:
function myFunction(arg1, arg2) {}; // This is OK, but...
You go on to state that this options "is better, and is properly scoped, but it leads to certain syntax problems once you get into closures." But you don't explain why or how it leads to syntax problems. You just expect me to believe your sentence without an example or evidence. I've never heard of issues with this syntax, and I'm disinclined to believe your statement without actual justification or reasoning behind it. Would you be able to at least link to an article or something to explain why?
Hey there, in the Combined var declarations section, the bug that you illustrate through accidentally forgetting a comma in a list of combined variable declarations is easily avoided by using the 'use strict';
directive, which causes an Uncaught ReferenceError to be thrown rather than silently creating a global variable.
I agree that using combined or multiple var
statements is a personal preference rather than a best-practice, but using strict mode wherever possible, definitely is a best practice :)
Is because node is more easy to install than ruby , or for working with bootstrap?.Because the last time i check, sass had more features and there were port of bootstrap in sass.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.