\def - Used for defining your own commands.
{ \def\myCommandName{ <replacement text> } }
\def command is used to define your own commands (control sequences, macros, definitions); must appear (within math delimiters) before it is used;
\def\myHearts{\color{purple}{\heartsuit}\kern-2.5pt\color{green}{\heartsuit}} \myHearts\myHearts
\def\myHearts#1#2{\color{#1}{\heartsuit}\kern-2.5pt\color{#2}{\heartsuit}} \myHearts{red}{blue}