Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const prescriptions = [...document.querySelectorAll("[data-purpose='selected-prescription']")];
- const titleDescStr = prescriptions.map(prescription => {
- const [titleElem, descElem] = [...prescription.children];
- return titleElem.textContent + ' ' + descElem.textContent;
- }).join('|');
- console.log(titleDescStr);
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; }return arr2; }}
- var prescriptions = _toConsumableArray(document.querySelectorAll("[data-purpose='selected-prescription']"));
- var titleDescStr = prescriptions.map(function (prescription) {
- var _ref = _toConsumableArray(prescription.children),
- titleElem = _ref[0],
- descElem = _ref[1];
- return titleElem.textContent + ' ' + descElem.textContent;
- }).join('|');
- console.log(titleDescStr);```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement