Suppose,
below is my dummy code with my scenario:
Hello.js file:
function hello(data){
var newlist = []
if(something == true){
for(let d in data){
newlist.push([d[tag]])
console.log("inside loop",newlist) //here it is printing the newlist logs as for loop goes on.
}
console.log("outside loop",newlist) //but it is not printing anything here
}
console.log(newlist) //but it is not printing anything here also.
return newlist //also not returning the newlist.
}
Here, please help me with the solution for this issue or atleast if you can give any idea what exactly can be the issue.