2

I have two different array list with different objects need to create one list based on creationDate.

ChatMessage :-

[{
    "creationDate": "2016-05-18 09:21:39",
    "creationUser": "#12:41",
    "message": "sssss",
    "userEmail": "[email protected]",
    "userName": "Miaai",
    "userSurname": "dsith",
    "isRead": false,
    "dossierId": "#88:1"
}, {.. so on ..}]

Document List:-

[{
    "name": "Hamlet.abook",
    "title": "Hamlet.abook",
    "inCompleteMetaData": true,
    "creationDate": "2016-05-17 11:25:23",
    "creationUser": "#12:41"
},{so on ...}]

OutPut Will be Based on creationDate

[{
    "name": "Hamlet.abook",
    "title": "Hamlet.abook",
    "inCompleteMetaData": true,
    "creationDate": "2016-05-17 11:25:23",
    "creationUser": "#12:41"
},{
    "creationDate": "2016-05-18 09:21:39",
    "creationUser": "#12:41",
    "message": "sssss",
    "userEmail": "[email protected]",
    "userName": "Miaai",
    "userSurname": "dsith",
    "isRead": false,
    "dossierId": "#88:1"
}]

1 Answer 1

1

Use union in underscorejs http://underscorejs.org/#union

_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
=> [1, 2, 3, 101, 10]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.