使用 CFSCRIPT 迴圈訪問集合

<cfscript>
  /*define collection*/
  attributes = {
    "name": "Sales",
    "type": "text",
    "value": "Connection"
  };
  for(attribute in attributes){
    /* attribute variable will contain the key name of each key value pair in loop */
    WriteOutput('Key : ' & attribute & ', Value : ' & attributes[attribute] & '<br/>');
  }
</cfscript>