Question about ListMap

LEGEND ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

Hello, all,

 

Just a quick question about ListMap.  According to the Adobe Help page, ListMap "Iterates over every entry of the list and calls the closure function to work on the item of the list."

 

I'm curious, though, if break will break out of the iteration. If ListMap is just a shortcut to a loop, then break would break out of that loop.  But if ListMap is something else, then maybe break won't work?

 

Just curious.

 

V/r,

 

^ _ ^

TOPICS
Advanced techniques, Asynchronous, Builder, cfchart, Cffiddle, Connector, Database access, Documentation, Event gateways, Flash integration, Getting started, Monitoring, Reporting, Security, Server administration

Views

478

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Jun 14, 2020 Jun 14, 2020
Hi WolfShade, When the documentation says, "Iterates over every entry of the list and calls the closure function to work on the item of the list", it indeed means ListMap will loop through the list. However, the implementation of ListMap doesn't offer any opportunity to include a break.  Including break within the closure won't work for the map as a whole. That is because the map is designed to iterate over every entry of the list.

Likes

Translate

Translate
Adobe Community Professional ,
Jun 14, 2020 Jun 14, 2020

Copy link to clipboard

Copied

Hi WolfShade,

When the documentation says, "Iterates over every entry of the list and calls the closure function to work on the item of the list", it indeed means ListMap will loop through the list. However, the implementation of ListMap doesn't offer any opportunity to include a break. 

Including break within the closure won't work for the map as a whole. That is because the map is designed to iterate over every entry of the list.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2020 Jun 15, 2020

Copy link to clipboard

Copied

LATEST

AH!  I was wondering why break wouldn't work in ListMap, I'm assuming same for ArrayMap.

 

Thank you for the explanation.

 

V/r,

 

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines