Affiliate Programs
 
Search affiliate programs for: 
Affiliate Categories
» Affiliate Networks
» Ad Networks
» 2 Tier Programs
» Pay Per Sale
» Pay Per Lead
» Residual Income
» Datafeeds
» Multi Tier Programs
» Business Opps
» Other Programs

Newsletter
Get newly added affiliate programs by email. Enter your email here:
Article Categories
» Affiliate Marketing
» Business
» Ecommerce
» Hosting
» Marketing
» Sales
» Web Designing
» Webmasters
» SEO & Promotion
» Working At Home
» Other Articles
» Affiliate Glossary


Go Back   AffiliateSeeking Forum > Website Creation, Design & Maintenance > Programming > JavaScript

JavaScript Discuss about JavaScript problems you are having or help others with their JavaScript issues.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-18-2013, 07:22 AM
Boby Smith Boby Smith is offline
Senior Member
 
Join Date: Dec 2011
Location: Ahmedabad(India)
Posts: 125
Boby Smith is on a distinguished road
Default JavaScript: var functionName = function() {} vs function functionName() {}

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.

The previous developer uses two ways of declaring functions and I can't work out if there is a reason behind it or not.

The two ways are:

var functionOne = function() {
// Some code
};

function functionTwo() {
// Some code
}

What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT +1. The time now is 11:25 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0
© 2004-2011 AffiliateSeeking. All rights reserved.