{"ScriptPreparationCode":null,"TestCases":[{"Name":"Date Object without lodash","Code":"const articles = [\u002210-2-2021\u0022, \u00229-3-2022\u0022, \u00222-4-2021\u0022]; \r\nconst byYear = {};\r\n articles.forEach(el =\u003E {\r\n const year = new Date(el).getFullYear();\r\n const objYear = byYear[year];\r\n byYear[year] = Array.isArray(objYear) ? [...objYear, el] : [el];\r\n });","IsDeferred":false},{"Name":"String Parse with lodash","Code":"const articles = [\u002210-2-2021\u0022, \u00229-3-2022\u0022, \u00222-4-2021\u0022];\r\nconst articleYear = (posted_date) =\u003E posted_date.split(\u0022-\u0022).pop();\r\nconst articlesByYear = _.groupBy(articles, articleYear);","IsDeferred":false}]}