Concatenative mapdashery.

\href{http://ci.testling.com/substack/node-concat-map}{\texttt{ }}

\href{http://travis-ci.org/substack/node-concat-map}{\texttt{ }}\hypertarget{md_sfcode_node_modules_concat_map_README_autotoc_md6127}{}\doxysection{example}\label{md_sfcode_node_modules_concat_map_README_autotoc_md6127}

\begin{DoxyCode}{0}
\DoxyCodeLine{var concatMap = require('concat-\/map');}
\DoxyCodeLine{var xs = [ 1, 2, 3, 4, 5, 6 ];}
\DoxyCodeLine{var ys = concatMap(xs, function (x) \{}
\DoxyCodeLine{    return x \% 2 ? [ x -\/ 0.1, x, x + 0.1 ] : [];}
\DoxyCodeLine{\});}
\DoxyCodeLine{console.dir(ys); }

\end{DoxyCode}


\DoxyHorRuler{0}



\begin{DoxyCode}{0}
\DoxyCodeLine{[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_concat_map_README_autotoc_md6128}{}\doxysection{methods}\label{md_sfcode_node_modules_concat_map_README_autotoc_md6128}

\begin{DoxyCode}{0}
\DoxyCodeLine{var concatMap = require('concat-\/map') }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_concat_map_README_autotoc_md6129}{}\doxysubsection{concat\+Map(xs, fn)}\label{md_sfcode_node_modules_concat_map_README_autotoc_md6129}
Return an array of concatenated elements by calling {\ttfamily fn(x, i)} for each element {\ttfamily x} and each index {\ttfamily i} in the array {\ttfamily xs}.

When {\ttfamily fn(x, i)} returns an array, its result will be concatenated with the result array. If {\ttfamily fn(x, i)} returns anything else, that value will be pushed onto the end of the result array.\hypertarget{md_sfcode_node_modules_concat_map_README_autotoc_md6130}{}\doxysection{install}\label{md_sfcode_node_modules_concat_map_README_autotoc_md6130}
With \href{http://npmjs.org}{\texttt{ npm}} do\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{npm install concat-\/map }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_concat_map_README_autotoc_md6131}{}\doxysection{license}\label{md_sfcode_node_modules_concat_map_README_autotoc_md6131}
MIT\hypertarget{md_sfcode_node_modules_concat_map_README_autotoc_md6132}{}\doxysection{notes}\label{md_sfcode_node_modules_concat_map_README_autotoc_md6132}
This module was written while sitting high above the ground in a tree. 