Create an Array / List

Use this code to build an array. The last line will return a 1.

  1. #set ($jobTypeArr = {})  
  2.   
  3. #set ($dummy = $jobTypeArr.put("a""1"))  
  4. #set ($dummy = $jobTypeArr.put("b""2"))  
  5. #set ($dummy = $jobTypeArr.put("c""3"))  
  6. #set ($dummy = $jobTypeArr.put("d""4"))  
  7.   
  8. $jobTypeArr.get('a')  
comments powered by Disqus