1. JavaScript / Говнокод #28577

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    export function compareTwoObjectExceptTime (obj1, obj2) {
      const obj1Copy = { ...obj1 }
      const obj2Copy = { ...obj2 }
      delete obj1Copy.ScheduledStartOn
      delete obj1Copy.ScheduledFinishOn
      delete obj1Copy.FinishedStartOn
      delete obj1Copy.FinishedFinishOn
      delete obj1Copy.ScheduledDuration
      delete obj1Copy.FinishedDuration
      delete obj1Copy.tasks
    
      delete obj2Copy.ScheduledStartOn
      delete obj2Copy.ScheduledFinishOn
      delete obj2Copy.FinishedStartOn
      delete obj2Copy.FinishedFinishOn
      delete obj2Copy.ScheduledDuration
      delete obj2Copy.FinishedDuration
      delete obj2Copy.tasks
      return JSON.stringify(obj1Copy) === JSON.stringify(obj2Copy)
    }

    Запостил: tosetac135, 30 Января 2023

    Комментарии (1) RSS

    • Объекты в скриптоязыке. Божественно...

      p.s. Ты хотел удивить нас, запостив говнокод на js?
      Ответить

    Добавить комментарий