I quite often see JavaScript with variables that start with a dollar sign. When/why would you choose to prefix a variable in this way?  (I'm not asking about $('p.foo') syntax that you see in jQuery and others, but normal variables like...
Is the underscore prefix in JavaScript only a convention, like for example in Python private class methods are?  From the 2.7 Python documentation:     “Private” instance variables that   cannot be accessed except from inside   an object don’...
The code in question is here:   var $item = $(this).parent().parent().find('input');   What is the purpose of the dollar sign in the variable name, why not just exclude it?...
Are there any standard ways of marking a function argument as unused in JavaScript, analogous to starting a method argument with an underscore in Ruby?...
I have always wondered when to use identifiers (for example, functions) with capital first letter instead of camel case. I always write my JS in camel case like this:  function doStuff() {}  var simpleVar = 'some stuff',     myAry = [],     m...
I am creating a instance of a class using the following code:    test = new function(){     ...   }   However, base has no prototype because it was created from an anonymous function (I'm guessing this is the reason?).  This leaves me unable to c...
While coding JavaScript sometimes you store the reference of object this in a local variable for different purposes (to set proper scope, to help code obfuscators, etc.). There are coders who prefer aliasing this to that to make it obvious its intent...
I know there is a lot of controversy (maybe not controversy, but arguments at least) about which naming convention is the best for JavaScript.  How do you name your variables, functions, objects and such?  I’ll leave my own thoughts on this out, a...
There are many popular JavaScript libraries and applications on GitHub and some put their raw source code in a /src directory, and others in a /lib directory.  I'm leaning towards the developers having done this depending on which languages they...
Let's say I have a function in a view that triggers when some kind of state is changed. What would be best to name it and why?   stateChange stateChanged onStateChange onStateChanged...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.