Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. searchBest() {
  2. if (this.selectedRtTariffs.length) {
  3. this.selectedRtTariffs.forEach((item) => {
  4. if (this.checkToDefined(item.price) && item.price < this.bestData.price) {
  5. this.bestData.price = item.price;
  6. }
  7.  
  8. if (this.checkToDefined(item.shpd) && item.shpd.speed > this.bestData.shpd) {
  9. this.bestData.shpd = item.shpd.speed;
  10. }
  11.  
  12. if (this.checkToDefined(item.tv) && item.tv.channelsCount > this.bestData.tv) {
  13. this.bestData.tv = item.tv.channelsCount;
  14. }
  15.  
  16. if (this.checkToDefined(item.mvno) && item.mvno.gbCount > this.bestData.mvno) {
  17. this.bestData.mvno = item.mvno.gbCount;
  18. }
  19. });
  20. }
  21.  
  22. if (this.selectedProviderTariffs.length) {
  23. this.selectedProviderTariffs.forEach((item) => {
  24. if (this.checkToDefined(item.price) && item.price < this.bestData.price) {
  25. this.bestData.price = item.price;
  26. }
  27.  
  28. if (this.checkToDefined(item.shpd) && item.shpd.speed > this.bestData.shpd) {
  29. this.bestData.shpd = item.shpd.speed;
  30. }
  31.  
  32. if (this.checkToDefined(item.tv) && item.tv.channelsCount > this.bestData.tv) {
  33. this.bestData.tv = item.tv.channelsCount;
  34. }
  35.  
  36. if (this.checkToDefined(item.mvno) && item.mvno.gbCount > this.bestData.mvno) {
  37. this.bestData.mvno = item.mvno.gbCount;
  38. }
  39. });
  40. }
  41. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement