Atlassian interview question

JS or react with recursion