This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let listOfArticles = ["HLP63P2I","HLP63P2I","R9T7FVD9","PLI82PFU","M62JFW8Q","W6FXWZHC","URVX9S22","UVF2BX3S","HH3R72BH","EUKZS3QR","PKRP3W4J","56YI28BH","WWZF8Z2V","YKEBAEX7","SB66FSJQ","HHJ739BB","VV26P2K9","ZZIDA78D","NWHASTVQ","RBLMDELC","BUEWZ258","3CQWK77M","WZBL4WV3","ZMPW6UQE","3APZQIYN","3XR95DME","C238ZP3G","PUIK8SYL","PQ7GP3G9","8EGSYTF4","SLEFYRWL","KVBLVJUU","YAPQI5C8","46NMCHCI","MBR34K6L","8K5HT8XM","WGLQYDYA","6MIN5N8G","9K6BU7U4","VWBWABD9","RWHZFBTC","GUBE5PM2","UCZZ7MFD","9T29K75C","J39EPBQU","44AFAI9W","JN8EEGB2"]; | |
console.log(listOfArticles.length); | |
/* == The functional programming solution == https://stackoverflow.com/questions/43241174/javascript-generating-all-combinations-of-elements-in-a-single-array-in-pairs == */ | |
let firstApproach = listOfArticles.flatMap( | |
(v, i) => listOfArticles.slice(i+1).map( w => v + ' ' + w ) | |
); | |
// console.log(firstApproach); | |
console.log(firstApproach.length); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const resursaModel = require('../../models/resursa-red'); | |
const competenteS = require('../../models/competenta-specifica'); | |
module.exports = (params) => { | |
return resursaModel.find({_id: params.idres}).populate({ | |
path: 'competenteS' | |
}).exec().then( (resursa) => { | |
// console.log(resursa); | |
if (resursa[0].content) { | |
let articleHTML = ''; | |
resursa[0].content.blocks.map(obj => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Settings for Atom |