---
agentTools:
  projectIndex: https://nativescript-enumerable.readme.io/llms.txt
---

# takeWhile

Takes elements while a condition matches.

[block:code]
{
  "codes": [
    {
      "code": "// 22, 33, 44\nEnumerable.create(22, 33, 44, 55)\n          .takeWhile('x => x < 50');",
      "language": "javascript"
    }
  ]
}
[/block]