How can I only display one link rather than many?

So using this snippet:

   <?php
   foreach((get_the_category()) as $childcat) {
if (cat_is_ancestor_of(10, $childcat)) {
echo '<a href="'.get_category_link($childcat->cat_ID).'">';
 echo $childcat->cat_name . '</a>';
}}
?>

I’m able to output all the child categories of the parent category with the id 106. However, I only want to output one child category if there’s more than one. How can I do this, please?

Solutions Collecting From Web of "How can I only display one link rather than many?"