« first day (3570 days earlier)      last day (547 days later) » 

 
1 hour later…
 
2 hours later…
 
3 hours later…
05:42
@VLAZ Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
@VLAZ undefined Logged: [ '"g"', '"f"' ] Took: 0ms
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
3 messages moved from JavaScript
@VLAZ undefined Logged: [ '"f"', '"g"', '"f"' ] Took: 0ms
1 message moved from JavaScript
 
4 hours later…
09:28
How to access age value from the array of object in javascript?

const data = [{
"hello":'thameem',
"age":24
},
{
"hello":'thameem',
"age":25
}];
console.log(data);

I need all age values
1 message moved from JavaScript
 
1 hour later…
 
4 hours later…
 
4 hours later…
router('/:id', async(req, res) {
if (req.body._id == req.params.id) {

try {
const user = await User.find(req.params.id):
let oldfirstName = user.firstname;
let oldlastName = user.lastname;

const author = oldfirstName + ' '  + oldlastName;

const postsByUser = await Post.find({author: author}); // gets posts by same user

const updatedUser = await User.findByIdAndUpdate(req.params.id, {
{
$set: {
firstname: req.body.firstname,
lastname: req.body.lastname,
}
}
});

let updatedAuthor = updatedUser.firstname + ' '  + updatedUser.lastname;
1 message moved from JavaScript
 
1 hour later…
 
2 hours later…

« first day (3570 days earlier)      last day (547 days later) »