# Pass array as macro argument

I want to be able to pass an array as a macro argument as for example :

//For each links in #1 print it
}

Is it possible in LaTeX ?

\documentclass{article}
\usepackage{listofitems,url}
\begin{document}
}

\end{document}

Just for fun: without additional packages.

\documentclass{article}
\usepackage{url}
\makeatletter
\@for\next:=#2\do{\expandafter\url\expandafter{\next}#1}%
}
\makeatother
\begin{document}

\end{document}

As a third alternative you can also do this:

\documentclass{article}

\usepackage{pgffor}
\usepackage{hyperref}

\foreach[count=\i] \j in {#1} {%
\ifnum\i>1 , \fi%
\url{\j}%
}
}

\setlength\parindent{0pt}

\begin{document}

https://www.aaa.com,
https://www.bbb.com,
https://www.ccc.com,
https://www.ddd.com,
https://www.eee.com,
https://www.fff.com
}

\end{document}

LaTeX3 novice's solution:

\documentclass{article}

\usepackage{expl3}
\usepackage{url}
\usepackage{xparse}

\ExplSyntaxOn

\NewDocumentCommand { \printLinks } { O{\par} m }
{