I am looking to use .apply for function inside function. I remain confused in .apply so if you could please help! I have my code as this.