In a declarative style the idea is to write code that describes what will be done, not how it will be done. My fav examples are from recursion:
const reverseString = (str) => {
if (str.length < 2) return str
const [first, ...rest] = str
return reverseString(rest) + first