Uma função redundante

Published by Helen Yu in

Escreva uma função redundant que receba uma string str e retorne uma função que retorne str.

Exemplos

const f1 = redundant("apple")
f1() ➞ "apple"

const f2 = redundant("pear")
f2() ➞ "pear"

const f3 = redundant("")
f3() ➞ ""

Observações

Sua função deve retornar uma função, não uma string.