• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
SEjack Avatar
Name:Unknown
Clan:Unknown
Member Since:May 2016
Last Seen:Feb 2020
Profiles:
    Following:0
    Followers:3
    Allies:0
    View Profile Badges
    • Stats
    • Kata
    • Collections
    • Kumite
    • Social
    • Discourse
    • Conversations (4)
    • Replies
    • Authored
    • Needs Resolution
    • Custom User Avatar
      • Unnamed
      • commented on "Is Integer Array ?" kata
      • 9 years ago

      !arr would be wrong too. Array is an Object and any object is true-ish.

    • Custom User Avatar
      • AcesOfGlory
      • commented on "Is Integer Array ?" kata
      • 9 years ago

      Because in JavaScript [] == [] returns false - you cannot directly compare arrays. I suggesting reading this or this for information why. If you are checking an empty array, I suggest using Boolean, e.g. if !arr or arr.length==0.

      Edit: Fuck, jinx beat me to it again :P

    • Custom User Avatar
      • myjinxin2015
      • commented on "Is Integer Array ?" kata
      • 9 years ago

      Wrong: arr==[]
      Right: arr.length==0

    • Custom User Avatar
      • SEjack
      • commented on "Is Integer Array?" kata
      • 9 years ago

      My code:

      function isIntArray(arr) {
      if(arr == []) {
      return true;
      }
      }

      is returning "undefined" on the first test - how??

    • © 2025 Codewars
    • About
    • API
    • Blog
    • Privacy
    • Terms
    • Code of Conduct
    • Contact

    Confirm

    • Cancel
    • Confirm

    Collect: undefined

    Loading collection data...