Skip to main content
changed desired result
Source Link
Pro Dev
  • 684
  • 1
  • 9
  • 28

Hello I'am new to programming and I stumble upon on grouping array data by date from two arrays.

here is my arrays:

header = [
    {"2019-04-22": "Sun, Apr 22, 2019"},
    {"2019-04-21": "Sat, Apr 21, 2019"},
]

body = [
    {"2019-04-22": "doing customer support”},
    {"2019-04-22": "reply to emails"},
    {"2019-04-21": "send message to customers"},
]

How do I group the arrays into one array as example below

combinearray = {
    "2019-04-22": [
        {"2019-04-22": "Sun, Apr 22, 2019"},
        {"2019-04-22": "doing customer support"},
        {"2019-04-22": "reply to emails"},
    ],
    "2019-04-21": [
        {"2019-04-21": "Sat, Apr 21, 2019"},
        {"2019-04-21": "send message to customers"},
    ],
}

Grouping two array data by date seems completely not easy for me I'm a beginner to javascript programming. I would appreciate any answers.

Hello I'am new to programming and I stumble upon on grouping array data by date from two arrays.

here is my arrays:

header = [
    {"2019-04-22": "Sun, Apr 22, 2019"},
    {"2019-04-21": "Sat, Apr 21, 2019"},
]

body = [
    {"2019-04-22": "doing customer support”},
    {"2019-04-22": "reply to emails"},
    {"2019-04-21": "send message to customers"},
]

How do I group the arrays into one array as example below

combinearray = {
    "2019-04-22": [
        {"2019-04-22": "Sun, Apr 22, 2019"},
        {"2019-04-22": "doing customer support"},
        {"2019-04-22": "reply to emails"},
    ],
    "2019-04-21": [
        {"2019-04-21": "Sat, Apr 21, 2019"},
        {"2019-04-21": "send message to customers"},
    ],
}

Grouping two array data by date seems completely not easy for me I'm a beginner to javascript programming. I would appreciate any answers.

Hello I'am new to programming and I stumble upon on grouping array data by date from two arrays.

here is my arrays:

header = [
    {"2019-04-22": "Sun, Apr 22, 2019"},
    {"2019-04-21": "Sat, Apr 21, 2019"},
]

body = [
    {"2019-04-22": "doing customer support”},
    {"2019-04-22": "reply to emails"},
    {"2019-04-21": "send message to customers"},
]

How do I group the arrays into one array as example below

combinearray = {
    "2019-04-22": [
        "Sun, Apr 22, 2019",
        "doing customer support",
        "reply to emails",
    ],
    "2019-04-21": [
        "Sat, Apr 21, 2019",
        "send message to customers",
    ],
}

Grouping two array data by date seems completely not easy for me I'm a beginner to javascript programming. I would appreciate any answers.

edited tags
Link
Jack Bashford
  • 44.3k
  • 11
  • 56
  • 84
edited body
Source Link
Pro Dev
  • 684
  • 1
  • 9
  • 28

Hello I'am new to programming and I stumble upon on grouping array data by date from two arrays.

here is my arrays:

header = [
    {"2019-04-22": "Sun, Apr 22, 2019"},
    {"2019-04-21": "Sat, Apr 21, 2019"},
]

body = [
    {"2019-04-22": "doing customer support”},
    {"2019-04-22": "reply to emails"},
    {"2019-04-21": "send message to customers"},
]

How do I group the arrays into one array as example below

combinearray = [{
    "2019-04-22": [
        {"2019-04-22": "Sun, Apr 22, 2019"},
        {"2019-04-22": "doing customer support"},
        {"2019-04-22": "reply to emails"},
    ],
    "2019-04-21": [
        {"2019-04-21": "Sat, Apr 21, 2019"},
        {"2019-04-21": "send message to customers"},
    ],
]}

Grouping two array data by date seems completely not easy for me I'm a beginner to javascript programming. I would appreciate any answers.

Hello I'am new to programming and I stumble upon on grouping array data by date from two arrays.

here is my arrays:

header = [
    {"2019-04-22": "Sun, Apr 22, 2019"},
    {"2019-04-21": "Sat, Apr 21, 2019"},
]

body = [
    {"2019-04-22": "doing customer support”},
    {"2019-04-22": "reply to emails"},
    {"2019-04-21": "send message to customers"},
]

How do I group the arrays into one array as example below

combinearray = [
    "2019-04-22": [
        {"2019-04-22": "Sun, Apr 22, 2019"},
        {"2019-04-22": "doing customer support"},
        {"2019-04-22": "reply to emails"},
    ],
    "2019-04-21": [
        {"2019-04-21": "Sat, Apr 21, 2019"},
        {"2019-04-21": "send message to customers"},
    ],
]

Grouping two array data by date seems completely not easy for me I'm a beginner to javascript programming. I would appreciate any answers.

Hello I'am new to programming and I stumble upon on grouping array data by date from two arrays.

here is my arrays:

header = [
    {"2019-04-22": "Sun, Apr 22, 2019"},
    {"2019-04-21": "Sat, Apr 21, 2019"},
]

body = [
    {"2019-04-22": "doing customer support”},
    {"2019-04-22": "reply to emails"},
    {"2019-04-21": "send message to customers"},
]

How do I group the arrays into one array as example below

combinearray = {
    "2019-04-22": [
        {"2019-04-22": "Sun, Apr 22, 2019"},
        {"2019-04-22": "doing customer support"},
        {"2019-04-22": "reply to emails"},
    ],
    "2019-04-21": [
        {"2019-04-21": "Sat, Apr 21, 2019"},
        {"2019-04-21": "send message to customers"},
    ],
}

Grouping two array data by date seems completely not easy for me I'm a beginner to javascript programming. I would appreciate any answers.

Source Link
Pro Dev
  • 684
  • 1
  • 9
  • 28
Loading