Array

In Bnlang, Array works like in JavaScript but can also be used with Bangla and Banglish names.
Available as Array, তালিকা, and Talika.
Use these for creating and working with lists of values.


Static Methods

  • Array.isArray() → also available as তালিকা.তালিকা_কি, Talika.talikaKi
  • Array.from() → also available as তালিকা.থেকে, Talika.theke
  • Array.fromAsync() → also available as তালিকা.অসমলয়_থেকে, Talika.osomoloyTheke
  • Array.of() → also available as তালিকা.এর, Talika.er

Prototype Methods (Common)

  • Add/Remove → push() (শেষে_যোগ, shesheJog), pop() (শেষ_উপাদান, sheshUpadan)
  • Shift/Unshift → shift() (প্রথম_উপাদান, prothomUpadan), unshift() (প্রথমে_যোগ, prothomeJog)
  • Map/Filter → map() (মাপ, map), filter() (বাছাই, bachai)
  • Reduce → reduce() (কমান, koman), reduceRight() (ডান_থেকে_কমান, danThekeKoman)
  • ForEach → forEach() (প্রতিটি_চালাও, protitiCalao)

Property Names

  • .length can also be accessed as দৈর্ঘ্য (Bangla) or doirghyo (Banglish).

Examples

const তালিকা১ = তালিকা.এর(1, 2, 3);
কনসোল.লগ(তালিকা১); // [1, 2, 3]

তালিকা১.শেষে_যোগ(4);
কনসোল.লগ(তালিকা১.দৈর্ঘ্য); // 4