node.js - How to show value from expression using EJS template -


i'm using ejs template in nodejs while printing value have give below

  <%= json.stringify(users.emails)  %>  <h2> hello, [{"value":"email@gmail.com"}]</h2> 

while priting above line. im getting [{"value":"email@gmail.com"}] want email@gmail.com. please me out. im getting response facebook

{      "id":"11125897590",    "displayname":"name",    "name":{       },    "emails":[         {            "value":"emailbala@gmail.com"       }    ], 

if users.emails.length == 1 then:

<%= json.stringify(users.emails[0].value) %> 

else:

<% for(var = 0; i< users.emails.length; i++) { %>     <%= json.stringify(users.emails[i].value) %> <%}%> 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -