https://github.com/andersontr15/left-join
Simple Left Join Utility Function Written In JavaScript
https://github.com/andersontr15/left-join
Last synced: 11 months ago
JSON representation
Simple Left Join Utility Function Written In JavaScript
- Host: GitHub
- URL: https://github.com/andersontr15/left-join
- Owner: andersontr15
- Created: 2018-07-22T03:42:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-29T22:25:16.000Z (over 7 years ago)
- Last Synced: 2025-01-11T03:20:31.418Z (about 1 year ago)
- Language: JavaScript
- Size: 41 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Left Join in JavaScript
## Usage
```javascript
const customers = [
{ id: 1, name: 'Theo' },
{ id: 5, name: 'John'}
];
const orders = [
{ customer_id: 1, order_name: 'Pepperoni Pizza', id: 1 },
{ customer_id: 10, order_name: 'Pasta Marinara', id: 2}
];
const results = left_join(orders, customers, 'customer_id');
/* [
{
customer_id: 1,
id: 1,
name: "Theo",
order_name: "Pepperoni Pizza"
},
{
customer_id: 10,
id: 2,
order_name: 'Pasta Marinara'
}
]
*/
console.table(results)
```
