Thanks Guys for the answer. It has solved the problem, even though I am new to using forEach() method inside forEach.