Function (Constructor)
You can build functions dynamically using the constructor: Function
, নির্মাতা_ফাংশন
, or NirmataFunction
.
It accepts parameter names and a body string, returning a new function object.
Static Helpers
- Invoke:
.call()
→নির্মাতা_ফাংশন.ডাকুন
,NirmataFunction.dakun
- Apply:
.apply()
→নির্মাতা_ফাংশন.প্রয়োগ
,NirmataFunction.proyog
- Bind:
.bind()
→নির্মাতা_ফাংশন.বাঁধো
,NirmataFunction.badho
- To string:
.toString()
→নির্মাতা_ফাংশন.অক্ষরমালায়_রুপান্তর
,NirmataFunction.okkhoromalayRupantor
- Properties:
.name
(নাম
,nam
),.length
(দৈর্ঘ্য
,doirghyo
)
Examples
const f1 = new নির্মাতা_ফাংশন("ক", "খ", "return ক + খ;");
কনসোল.লগ(f1(2, 3)); // 5
কনসোল.লগ(নির্মাতা_ফাংশন.ডাকুন.call(f1, null, 4, 6)); // 10
কনসোল.লগ(f1.নাম); // "anonymous"
কনসোল.লগ(f1.দৈর্ঘ্য); // 2