web stats
create an array for Mirth usage - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2014, 11:37 AM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 957
StickyBandit is on a distinguished road
Question create an array for Mirth usage

Is there any difference in these two javascript lines?

var myArray = ["hello", "world"];

var myArray = new Array("hello", "world");
Reply With Quote
  #2  
Old 03-13-2014, 11:53 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Yes; the second line would explicitly call the constructor on the Array prototype, whereas the first line is using the internal initialiser to form an ArrayLiteral. For more info: http://www.ecma-international.org/pu...s/Ecma-262.htm
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 03-14-2014, 09:00 AM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 957
StickyBandit is on a distinguished road
Question

That is a great ECMA manual, but how do I decide which one to use in Mirth?
Reply With Quote
  #4  
Old 03-14-2014, 09:04 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Quote:
Originally Posted by StickyBandit View Post
That is a great ECMA manual, but how do I decide which one to use in Mirth?
I suppose it depends on whether you necessarily want the constructor to be explicitly called or not.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:25 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation