ShadowMage Posted February 8, 2010 Share Posted February 8, 2010 Hi again,I'm just wondering if it's possible to create a function that takes unlimited arguments like the document.write() function. If so, how would I go about doing that?I understand I could create an array and pass the array to the function, but I don't really want to create an array to store the values when I can just type in the values I want instead. Especially with shorter lists of three or four values.Help is appreciated. Thank you. Link to comment Share on other sites More sharing options...
justsomeguy Posted February 8, 2010 Share Posted February 8, 2010 You can use the arguments array inside a function to loop through the arguments that were passed:https://developer.mozilla.org/en/Core_JavaS...tions/arguments Link to comment Share on other sites More sharing options...
ShadowMage Posted February 8, 2010 Author Share Posted February 8, 2010 Wow, that was quick! Thanks, jsg works like a charm! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.