Write a function to flatten a nested JavaScript object.Write a function to find duplicate values in an array.Write a debounce function that limits the rate a function is called.Write a recursive function to reverse a string.