The string ''+notify_name+' likes your post.' is coming from the database. We are storing this static string in the database.
variable ntfnFound[0].body contains this string that we fetched from the database.
var notify_name = 'tintu';
console.log(ntfnFound[0].body); /* ''+notify_name+' likes your post.' */
var body = ntfnFound[0].body;
console.log(body); /* ''+notify_name+' likes your post.' */
console.log(''+notify_name+' likes your post.'); /*tintu likes your post*/
My question is,
In the above code why not 'console.log(body);' displays 'tintu likes your post' ??
or
Why +notify_name+ is not getting replaced ??
Also is there any solution for converting the string in 'var body' to 'tintu likes your post' ??
IN the following code works,
console.log(''+notify_name+' likes your post.'); /*tintu likes your post*/