This project is archived and is in readonly mode.

#366 ✓resolved

Array.clean() does not work as expected

Reported by jtreitz | September 5th, 2008 @ 12:36 PM | in 1.2.1

Array.clean() is said to remove 0, false, null and "" but actually doesnt work for 0, false or ""


var cleanedArray = [0, 3, null, false, true, "foo", ""].clean(); //cleanedArray = [3, true, "foo"]

What I get

[0, 3, false, true, "foo", ]

Comments and changes to this ticket

  • Jan Kassens

    Jan Kassens September 6th, 2008 @ 11:27 AM

    • Assigned user changed from “Valerio” to “Jan Kassens”
    • State changed from “new” to “resolved”
    • Tag changed from array, core, defect, minor to docs
    • Milestone changed from 2.0 to 1.2.1

    The docs were outdated. Use myArray.filter($arguments(0)); to get the old behaviour.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket