Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Find items from json array using NodeJS
- // use the arrow function version of ECMAScript 2015:
- var result = [
- {
- server: 'deskes.com',
- result: 'succes'
- },
- {
- server: 'cleantarge.com',
- result: 'Failed'
- },
- {
- server: 'fance34.com',
- result: 'success'
- },{
- server: 'deskes.com',
- result: 'Failed'
- }
- ];
- var rta = result.filter(it => it.server === 'deskes.com');
- console.log(rta);
- /*
- Result:
- [
- {
- "server": "deskes.com",
- "result": "succes"
- },
- {
- "server": "deskes.com",
- "result": "Failed"
- }
- ]
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement