Parsing JSON and forming a customized array - javascript

What I have,
{
"rowId": "1",
"product_name": [
"Product 1",
"Product 2",
"Product 3",
"Product 4",
"Product 5"
],
"product_tag": [
"1112231",
"1112232",
"1112233",
"1112234",
"1112235"
],
"version_id": [
"1.0",
"2.0",
"1.5",
"3.0",
"2.5"
]
}
How I would like it to get transformed. (i.e, taking every element from each array in the JSON given above and forming a new array like below).
{
[
"Product 1",
"1112231",
"1.0"
],
[
"Product 2",
"1112232",
"2.0"
],
[
"Product 3",
"1112233",
"1.5"
],
[
"Product 4",
"1112234",
"3.0"
],
[
"Product 5",
"1112235",
"2.5"
]
}
What I've tried,
I've tried using the flatMap function of javascript (given below) but with no luck. (Note: Here testData refers to the JSON data pasted above)
[testData.product_name, testData.product_tag, testData.version_id].flatMap((i, index) => i[index]);
which returns only one record like this (where I need to get 5 in my case),
["Product 1","1112232","1.5"]
Can someone help?

You could use Array.from like this:
const input={"rowId":"1","product_name":["Product 1","Product 2","Product 3","Product 4","Product 5"],"product_tag":["1112231","1112232","1112233","1112234","1112235"],"version_id":["1.0","2.0","1.5","3.0","2.5"]}
const { product_name, product_tag, version_id } = input;
const output =
Array.from(input.product_name, (name, i) => ([ name, product_tag[i], version_id[i] ]))
console.log(output)
If you have unequal number of items in each array, you could get the biggest array's length to create the output
// or Math.min if you don't want undefined items
const length = Math.max(product_name.length, product_tag.length, version_id.length)
const output =
Array.from({ length }, (_, i) => ([ product_name[i] , product_tag[i], version_id[i] ]))

You could reduce the value/arrays and assign the items to the array with the same index.
var object = { rowId: "1", product_name: ["Product 1", "Product 2", "Product 3", "Product 4", "Product 5"], product_tag: ["1112231", "1112232", "1112233", "1112234", "1112235"], version_id: ["1.0", "2.0", "1.5", "3.0", "2.5"] },
result = Object.values(object).reduce((r, a) => {
Array.isArray(a) && a.forEach((v, i) => (r[i] = r[i] || []).push(v));
return r;
}, []);
console.log(result);
.as-console-wrapper { max-height: 100% !important; top: 0; }

You can use construct an array including the product_name, product_tag and version_id in the order you prefer. This is to make sure that the order is right. Use reduce to loop thru the array. Use forEach to loop in the inner array.
let data = {"rowId":"1","product_name":["Product 1","Product 2","Product 3","Product 4","Product 5"],"product_tag":["1112231","1112232","1112233","1112234","1112235"],"version_id":["1.0","2.0","1.5","3.0","2.5"]}
let result = [data.product_name, data.product_tag, data.version_id].reduce((c, v) => {
v.forEach((e, i) => {
c[i] = c[i] || [];
c[i].push(e);
});
return c;
}, []);
console.log(result);

let arr = obj.product_name.map((it,index)=>[it,obj.product_tag[index],obj.version_id[index]])

you can use do it like this if you want
const ar= {
"rowId": "1",
"product_name": [
"Product 1",
"Product 2",
"Product 3",
"Product 4",
"Product 5"
],
"product_tag": [
"1112231",
"1112232",
"1112233",
"1112234",
"1112235"
],
"version_id": [
"1.0",
"2.0",
"1.5",
"3.0",
"2.5"
]
};
let newAr = {};
for(var i = 0;i < ar.product_name.length;i++){
newAr[i]= [ar.product_name[i],ar.product_tag[i],ar.version_id[i]];
}

Related

Merge array of objects inside loop into new object

Trying to create a new object, and then join all the objects from nested values from a JSON file.
The JSON data is rather large, so have taken a sample, and called it var items
Problem I am having is that the nested data is not updating the new object.
var items = [
{
"id": 11,
"title": "Fruit Test",
"releaseDateTime": "2021-10-21T10:50:00+09:30",
"mainContent": "Fruit order for 1 person",
"storeNames": [
"Store 1"
],
"items": [
{
"itemName": "Melon",
"otherName": "Watermelon"
},
{
"itemName": "Apple",
"otherName": "Red apple"
}
]
},
{
"id": 12,
"title": "Canned Test",
"releaseDateTime": "2021-10-21T10:50:00+09:30",
"mainContent": "Canned order for 2 people",
"storeNames": [
"Store 1"
],
"items": [
{
"itemName": "Tomatoes",
"otherName": "Diced tomato"
}
]
},
{
"id": 13,
"title": "Dairy Test",
"releaseDateTime": "2021-10-21T10:50:00+09:30",
"mainContent": "Dairy Order for 2 people",
"storeNames": [
"Store 1"
],
"items": []
}
]
;
var copyItems = [];
for (let i = 0; i < items.length; i++) {
items[i].allItems = items[i].items;
copyItems.push(items[i])
}
console.log(copyItems);
var copyItems = copyItems.map(function(elem){
return elem.allItems;
}).join(",");
console.log(`These are the final items ${copyItems}`);
I am able to create the new object, and add the nested arrays to this. However I am trying to get the allItems object to display the information like the following:
[
{
"id": 11,
"allItems": "Melon, Apple",
"title": "Fruit Test",
"releaseDateTime": "2021-10-21T10:50:00+09:30",
"mainContent": "Fruit order for 1 person",
"storeNames": [
"Store 1"
],
"items": [
{
"itemName": "Melon",
"otherName": "Watermelon"
},
{
"itemName": "Apple",
"otherName": "Red apple"
}
]
},
{
"id": 12,
"allItems": "Tomatoes",
"title": "Canned Test",
"releaseDateTime": "2021-10-21T10:50:00+09:30",
"mainContent": "Canned order for 2 people",
"storeNames": [
"Store 1"
],
"items": [
{
"itemName": "Tomatoes",
"otherName": "Diced tomato"
}
]
},
{
"id": 13,
"allItems": "",
"title": "Dairy Test",
"releaseDateTime": "2021-10-21T10:50:00+09:30",
"mainContent": "Dairy Order for 2 people",
"storeNames": [
"Store 1"
],
"items": []
}
]
Here is my JSFiddle: https://jsfiddle.net/buogdvx9/6/
Javascript is still a language I am learning and working through, and some things still catch me out.
Thank you.
You can use Array.map() to create the new array, then using some destructuring to create each new element in this array.
We create the allitems property on each new element by first mapping the sub items array to get a list of subitem names, then using Array.join() to create a comma separated string.
The arrow function you see as the first argument to Array.map is another way of writing function(args) { .. }.
const items = [ { "id": 11, "title": "Fruit Test", "releaseDateTime": "2021-10-21T10:50:00+09:30", "mainContent": "Fruit order for 1 person", "storeNames": [ "Store 1" ], "items": [ { "itemName": "Melon", "otherName": "Watermelon" }, { "itemName": "Apple", "otherName": "Red apple" } ] }, { "id": 12, "title": "Canned Test", "releaseDateTime": "2021-10-21T10:50:00+09:30", "mainContent": "Canned order for 2 people", "storeNames": [ "Store 1" ], "items": [ { "itemName": "Tomatoes", "otherName": "Diced tomato" } ] }, { "id": 13, "title": "Dairy Test", "releaseDateTime": "2021-10-21T10:50:00+09:30", "mainContent": "Dairy Order for 2 people", "storeNames": [ "Store 1" ], "items": [] } ];
const result = items.map(({ id, ...rest}) => {
return {
id,
allItems: rest.items.map(el => el.itemName).join(', '),
...rest
};
});
console.log(result)
.as-console-wrapper { max-height: 100% !important; top: 0; }
Since you only want to update the existing object, using forEach to loop over each item in array, then loop over the prosperity with a map operator to get the array with itemName.
items.forEach((obj) => {
obj.allItems = obj.items.map((item) => item.itemName)
});
console.log(items)
Simple example:
// iterating over the items
for (let i = 0; i < items.length; i++) {
let currentItem = items[i];
currentItem.allItems = []; // adding new empty array
for (let j = 0; j < currentItem.items.length; j++) {
currentItem.allItems.push(currentItem.items[j].itemName);
}
}
Working Example:
var items = [
{
"id": 11,
"title": "Fruit Test",
"releaseDateTime": "2021-10-21T10:50:00+09:30",
"mainContent": "Fruit order for 1 person",
"storeNames": [
"Store 1"
],
"items": [
{
"itemName": "Melon",
"otherName": "Watermelon"
},
{
"itemName": "Apple",
"otherName": "Red apple"
}
]
},
{
"id": 12,
"title": "Canned Test",
"releaseDateTime": "2021-10-21T10:50:00+09:30",
"mainContent": "Canned order for 2 people",
"storeNames": [
"Store 1"
],
"items": [
{
"itemName": "Tomatoes",
"otherName": "Diced tomato"
}
]
},
{
"id": 13,
"title": "Dairy Test",
"releaseDateTime": "2021-10-21T10:50:00+09:30",
"mainContent": "Dairy Order for 2 people",
"storeNames": [
"Store 1"
],
"items": []
}
]
;
// since you only want to update the existing object, using map to loop over each item in array
items.forEach((obj) => {
// using map to create the new array of just itemNames
obj.allItems = obj.items.map((item) => item.itemName)
});
console.log(items)
Just use the combination of Array.map and Array.join
Logic
Since you want to create a new array, run Array.map on the parent array.
On each nodes in the parent return the whole node with one extra key allItems.
For allItems create a new array from items array in each node and join then with space
var items = [{"id":11,"title":"Fruit Test","releaseDateTime":"2021-10-21T10:50:00+09:30","mainContent":"Fruit order for 1 person","storeNames":["Store 1"],"items":[{"itemName":"Melon","otherName":"Watermelon"},{"itemName":"Apple","otherName":"Red apple"}]},{"id":12,"title":"Canned Test","releaseDateTime":"2021-10-21T10:50:00+09:30","mainContent":"Canned order for 2 people","storeNames":["Store 1"],"items":[{"itemName":"Tomatoes","otherName":"Diced tomato"}]},{"id":13,"title":"Dairy Test","releaseDateTime":"2021-10-21T10:50:00+09:30","mainContent":"Dairy Order for 2 people","storeNames":["Store 1"],"items":[]}];
const newItems = items.map(node => ({ ...node, allItems: node.items.map(item => item.itemName).join(" ")}));
console.log(newItems);

Filter data in NodeJS

I have a json array where it contains an objects having name and rating fields.I want to filter that array where rating is 5.It might be the easy one find but I got stuck.
Below is my json object.
let products = [
{
"name" : "product 1",
"rating" : 5
},
{
"name" : "product 2",
"rating" : 4
},
{
"name" : "product 3",
"rating" : 5
},
{
"name" : "product 4",
"rating" : 2
}]
Here I am using filter functionality but unable to get How can I use it properly.
This is the function I have written but its not working.
const prod = (products) => {
products.filter((proct) => {
if(proct === 5){
console.log(proct.name);
}
});
}
prod(products);
Someone let me know what I am doing wrong.
filter function must return a boolean as result
Function is a predicate, to test each element of the array. Return a value that coerces to true to keep the element, or to false otherwise.
Array.prototype.filter
let products = [{ "name": "product 1", "rating": 5 }, { "name": "product 2", "rating": 4 }, { "name": "product 3", "rating": 5 }, { "name": "product 4", "rating": 2 } ]
products = products.filter(({rating}) => rating === 5)
console.log(products)
Each item in your array is an object, and I guess you are looking for rating===5.
Your function should be:
let products = [{ "name": "product 1", "rating": 5 }, { "name": "product 2", "rating": 4 }, { "name": "product 3", "rating": 5 }, { "name": "product 4", "rating": 2 } ]
const prod = (products) => {
products.filter((proct) => {
if (proct.rating === 5) {
console.log(proct.name);
return true;
}
return false
});
}
prod(products)
Getting just name key:
Take a look at map function which create a new array from old array:
.map(({name}) => name)
Full code:
let products = [{ "name": "product 1", "rating": 5 }, { "name": "product 2", "rating": 4 }, { "name": "product 3", "rating": 5 }, { "name": "product 4", "rating": 2 } ]
products = products.filter(({rating}) => rating === 5).map(({name}) => name)
console.log(products)
Your code is not checking the property. But the object itself. Use the . operator to check the specific property:
let products = [
{
"name" : "product 1",
"rating" : 5
},
{
"name" : "product 2",
"rating" : 4
},
{
"name" : "product 3",
"rating" : 5
},
{
"name" : "product 4",
"rating" : 2
}]
const prod = (products) => {
products.filter((proct) => {
if(proct.rating === 5){
console.log(proct.name);
}
});
}
prod(products);
Your condition is comparing proct, an object, to the value 5. You probably forgot to access the rating property of proct:
products.filter((proct) => {
if(proct.rating === 5){
console.log(proct.name);
}
});
However, you are using filter wrong. Filter is a method whose entire point is to get all the elements in the array that answer a condition and return them, and not just iterate over an array and execute code (that's what forEach is for). A more correct code would be:
const filteredProducts = products.filter((proct) => proct.rating === 5);
console.log(filteredProducts); // [{ name: "product 1", rating: 5 }, { name: "product 3", rating: 5 }]
filteredProducts.forEach((proct) => console.log(proct.name));
This solution first retrieves all the products whose rating is 5 and then iterates over each of them to print their name.

Merge two arrays and compare by ID add new Property

Hopefully someone can help me out here.
I am building an angular app with SQLite database which stores existing values. I need to compare these values from a json array received over http.
They should be matched by code, I want to compare the existing values with the update values add the property "active" = 1 otherwise active = 0 .
I tried a double foreach loop below, but I guess what's happening is the index is off so the results are not accurate in my actual application.
I have lodash available if there is some way to do this using that.
Any help would be much appreciated.
How can I get the following output
/*epected output
[{
"name": "Person 1"
"code": '001',
"active": '1'
},
{
"name": "Person 2"
"code": '002',
"active": '1'
},
{
"name": "Person 3"
"code": '003',
"active": '0' // note active 0 since doesnt exist in exsting
}
]*/
and what I tried along with 500 other things.
const existing = [{
"name": "Person 1",
"code": '001',
},
{
"name": "Person 2",
"code": '002',
},
];
const update = [{
"name": "Person 1",
"code": '001',
},
{
"name": "Person 2",
"code": '002',
},
{
"name": "Person 3",
"code": '003',
},
];
existing.forEach(element => {
update.forEach(test => {
if (element.code === test.code) {
element.avtive = true;
} else {
element.avtive = false;
}
});
return element;
});
console.log(existing);
/*epected output
[{
"name": "Person 1"
"code": '001',
"active": '1'
},
{
"name": "Person 2"
"code": '002',
"active": '1'
},
{
"name": "Person 3"
"code": '003',
"active": '0' // note active 0 since doesnt exist in exsting
}
]*/
Here is what should work for you. All existing code are extracted and then, for each updated value it is checked whether code exists in existingCodes array.
const existingCodes = existing.map((e) => e.code);
const result = updated.map((e) => ({
...e,
active: existingCodes.includes(e.code) ? '1' : '0'
});
If includes doesn't work for you on IE, you can replace this line existingCodes.includes(e.code) with existingCodes.filter((code) => code === e.code).length.
I like #radovix answer above, which worked for me, I came up with something slightly more long-winded, but which gives the same end result, but also separate lists of active and inactive:
let active = update.filter(item =>{
return existing.find(exist=> exist.code == item.code);
});
let inactive = update.filter(item =>{
return !existing.find(exist=> exist.code == item.code);
});
active = active.map(item=>({...item, active: '1'}));
inactive= inactive.map(item=>({...item, active: '0'}));
const merged = [...this.active, ...this.inactive];
You can see both ways working here: https://stackblitz.com/edit/angular-merge-arrays-update-property
You can use reduce, find and remove item from update array as
let result= existing.reduce((acc, item)=>{
let found = update.find(c => c.name == item.name);
if (found != undefined) {
const index = update.indexOf(found);
if (index > -1) {
update.splice(index, 1);
}
}
item.active = true;
acc.push(item);
return acc;
},[]);
update.map(c=> c.active = false);
//console.log(update)
result = result.concat(update);
console.log(result);
const existing = [{
"name": "Person 1",
"code": '001',
},
{
"name": "Person 2",
"code": '002',
},
];
const update = [{
"name": "Person 1",
"code": '001',
},
{
"name": "Person 2",
"code": '002',
},
{
"name": "Person 3",
"code": '003',
},
];
let result= existing.reduce((acc, item)=>{
let found = update.find(c => c.name == item.name);
if (found != undefined) {
const index = update.indexOf(found);
if (index > -1) {
update.splice(index, 1);
}
}
item.active = true;
acc.push(item);
return acc;
},[]);
update.map(c=> c.active = false);
//console.log(update)
result = result.concat(update);
console.log(result);

Javascript: Collapse array of objects on property value, summing quantity property, retaining most recent

Looking for a more "functional" way of achieving this...
I have an object of products that looks like this (note duplicate skuid's)
"products": [
{
"skuid": "B1418",
"name": "Test Product 1",
"price": 7,
"lastOrderedDate": 20181114,
"quantity": 2
},{
"skuid": "B3446",
"name": "Test Product 2",
"price": 6,
"lastOrderedDate": 20190114,
"quantity": 2
},{
"skuid": "B1418",
"name": "Test Product 1",
"price": 7,
"lastOrderedDate": 20180516,
"quantity": 5
},{
"skuid": "B3446",
"name": "Test Product 2",
"price": 6,
"lastOrderedDate": 20180411,
"quantity": 11
}
]
I want to create a new array that has a single object for each distinct skuid but that SUMS all the quantity values and retains the newest lastOrderedDate.
The final result would look like:
"products": [
{
"skuid": "B1418",
"name": "Test Product 1",
"price": 7,
"lastOrderedDate": 20181114,
"quantity": 7
},{
"skuid": "B3446",
"name": "Test Product 2",
"price": 6,
"lastOrderedDate": 20190114,
"quantity": 13
}
]
I can do it with a bunch of forEach's and if's, but I'd like to learn a more concise way to do it. Perhaps with a sort, then reduce?
You can do that in following steps:
Create an object using reduce() whose keys will unique skuid and value will fist object with that skuid
Use forEach on the array and increase the quantity property of corresponding object in object created object.
Use Object.values() to get an array.
const products = [ { "skuid": "B1418", "name": "Test Product 1", "price": 7, "lastOrderedDate": 20181114, "quantity": 2 },{ "skuid": "B3446", "name": "Test Product 2", "price": 6, "lastOrderedDate": 20190114, "quantity": 2 },{ "skuid": "B1418", "name": "Test Product 1", "price": 7, "lastOrderedDate": 20180516, "quantity": 5 },{ "skuid": "B3446", "name": "Test Product 2", "price": 6, "lastOrderedDate": 20180411, "quantity": 11 } ]
const res = products.reduce((ac,a) => (!ac[a.skuid] ? ac[a.skuid] = a : '',ac),{})
products.forEach(x => res[x.skuid].quantity += x.quantity)
console.log(Object.values(res))
You could take a Map and get all values later as result set.
const
getGrouped = (m, o) => {
var item = m.get(o.skuid);
if (!item) return m.set(o.skuid, Object.assign({}, o));
if (item.lastOrderedDate < o.lastOrderedDate) item.lastOrderedDate = o.lastOrderedDate;
item.quantity += o.quantity;
return m;
};
var data = { products: [{ skuid: "B1418", name: "Test Product 1", price: 7, lastOrderedDate: 20181114, quantity: 2 }, { skuid: "B3446", name: "Test Product 2", price: 6, lastOrderedDate: 20190114, quantity: 2 }, { skuid: "B1418", name: "Test Product 1", price: 7, lastOrderedDate: 20180516, quantity: 5 }, { skuid: "B3446", name: "Test Product 2", price: 6, lastOrderedDate: 20180411, quantity: 11 }] },
result = Array.from(data.products
.reduce(getGrouped, new Map)
.values()
);
console.log(result);
.as-console-wrapper { max-height: 100% !important; top: 0; }
You can do it like this:
const DATA = [
{
"skuid": "B1418",
"name": "Test Product 1",
"price": 7,
"lastOrderedDate": 20181114,
"quantity": 2
},{
"skuid": "B3446",
"name": "Test Product 2",
"price": 6,
"lastOrderedDate": 20190114,
"quantity": 2
},{
"skuid": "B1418",
"name": "Test Product 1",
"price": 7,
"lastOrderedDate": 20180516,
"quantity": 5
},{
"skuid": "B3446",
"name": "Test Product 2",
"price": 6,
"lastOrderedDate": 20180411,
"quantity": 11
}
];
const mergeStrategy = {
quantity: (a, b) => a + b,
lastOrderedDate: (a, b) => Math.max(a, b)
}
const mergeByStrategy = strat => a => b => {
const c = Object.assign({}, a, b);
return Object.keys(strat).reduce((acc, k) => {
acc[k] = strat[k](a[k], b[k]);
return acc;
}, c);
}
const groupByWith = prop => merge => xs => xs.reduce((acc, x) => {
if (acc[x[prop]] === void 0) { acc[x[prop]] = x; }
else { acc[x[prop]] = merge(acc[x[prop]])(x); }
return acc;
}, {});
const mergeFunc = mergeByStrategy(mergeStrategy);
const groupData = groupByWith('skuid')(mergeFunc);
console.log(Object.values(groupData(DATA)))
mergeStrategy defines how certain properties are merged. You can define as much properties/functions here as you like.
The mergeByStrategy function first takes a strategy (see above), and then two objects to merge. Note that it takes the objects in a curried form. It creates a shallow copy of both objects which it modifies according to the given strategy. This ensures your original data is still intact.
The groupByWith function takes a property name, a merging function and an array of objects and creates a dictionary/POJO/hashmap/call-as-you-like where each object is stored by the given property name. If there already exists an entry in the dictionary, it uses the merging function to combine the existing entry with the new entry, otherwise is simply stores the new entry into the object.

Javascript count distinct value and sum lists in json array

For example, in the following json array each element has a name and a variable list of items in tracks.items
[
{
"name": "whatever",
"tracks": {
"items":
[
{
"item 1" : "some item"
},
...
]
}
},
{...}
...
]
In javascript, I need to find the number of distinct name's, as well as the sum of the length (size) of all tracks.items found in the entire array.
How do I use underscore or lodash to do that?. I've tried _.countBy() but that only returns individual counts
EDIT
thanks guys
(alternate solution)
const uniqueNames = new Set(array.map(item => item.name)).size
const totalItems = array.reduce((sum, item) => sum + item.tracks.items.length, 0)
As Stucco noted in his answer you can get the number of unique names, by checking the length of the result of _.uniqBy() by name.
You can get the total amount of track items using _.sumBy().
var arr = [{"name":"whatever","tracks":{"items":[{"item 1":"some item"},{"item 2":"some item"},{"item 3":"some item"}]}},{"name":"whatever","tracks":{"items":[{"item 4":"some item"},{"item 5":"some item"},{"item 6":"some item"},{"item 7":"some item"}]}},{"name":"whatever2","tracks":{"items":[{"item 8":"some item"},{"item 9":"some item"},{"item 10":"some item"},{"item 11":"some item"}]}}];
var uniqueNamesCount = _.uniqBy(arr, 'name').length;
var totalTracksItemsCount = _.sumBy(arr, 'tracks.items.length');
console.log('uniqueNamesCount', uniqueNamesCount); // 2
console.log('totalTracksItemsCount', totalTracksItemsCount); // 11
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js"></script>
let obj = [{
"name": "whatever",
"tracks": {
"items":
[
{
"item 1" : "some item"
},
...
]
}
},
{...}
...
];
let uniqueNames = _.uniqBy(obj, 'name').length;
let totalItemes = _.reduce(obj, (result, value) => result += value.tracks.items.length, 0);
Working example:
var obj = [{
"name": "whatever",
"tracks": {
"items": [{
"item 1": "some item"
},
{
"item 2": "some item"
}, {
"item 3": "some item"
}
]
}
}, {
"name": "whatever",
"tracks": {
"items": [{
"item 4": "some item"
},
{
"item 5": "some item"
}, {
"item 6": "some item"
}, {
"item 7": "some item"
}
]
}
}, {
"name": "whatever2",
"tracks": {
"items": [{
"item 8": "some item"
},
{
"item 9": "some item"
}, {
"item 10": "some item"
}, {
"item 11": "some item"
}
]
}
}]
let names = _.uniqBy(obj, 'name');
let uniqueNames = names.length
let items = _.reduce(obj, (result, value) => result += value.tracks.items.length, 0)
console.log(names);
console.log(uniqueNames)
console.log(items)
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js"></script>

Categories