Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. const prescriptions = [...document.querySelectorAll("[data-purpose='selected-prescription']")];
  2.  
  3. const titleDescStr = prescriptions.map(prescription => {
  4. const [titleElem, descElem] = [...prescription.children];
  5. return titleElem.textContent + ' ' + descElem.textContent;
  6. }).join('|');
  7.  
  8. console.log(titleDescStr);
  9.  
  10. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
  11.  
  12. function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
  13.  
  14. 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; }}
  15.  
  16.  
  17. var prescriptions = _toConsumableArray(document.querySelectorAll("[data-purpose='selected-prescription']"));
  18.  
  19. var titleDescStr = prescriptions.map(function (prescription) {
  20. var _ref = _toConsumableArray(prescription.children),
  21. titleElem = _ref[0],
  22. descElem = _ref[1];
  23.  
  24. return titleElem.textContent + ' ' + descElem.textContent;
  25. }).join('|');
  26.  
  27. console.log(titleDescStr);```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement