Keywords
Bnlang provides a rich set of keywords that can be used in three forms: English, Bangla, and Banglish.
All three map to the same meaning, so developers can code in the style they are most comfortable with.
Control flow
English | Bangla | Banglish | Description |
---|---|---|---|
if | যদি | jodi | Conditional branching. |
else | নাহলে | nahole | Alternative branch when condition fails. |
switch | বিকল্প | bikolpo | Multi-case branching. |
case | অবস্থা | obostha | A specific branch inside a switch. |
default | অন্যথায় | onnothay | Default branch in switch if no case matches. |
for | প্রতি | proti | Standard loop. |
while | যতক্ষণ | jotokkhon | Loop while condition is true. |
do | করুন | korun | Do-while loop, runs at least once. |
break | থামুন | thamun | Exit from loop/switch. |
continue | চলুন | colun | Skip current loop iteration. |
return | ফেরত | ferot | Return from function. |
throw | নিক্ষেপ | nikkhep | Throw an exception. |
try | চেষ্টা | ceshta | Start of error handling block. |
catch | ধরুন | dhorun | Handle an error/exception. |
finally | অবশেষে | obosheshe | Cleanup block after try/catch. |
Declarations / Classes
English | Bangla | Banglish | Description |
---|---|---|---|
var | চলক | cholok | Declare a variable (function-scoped). |
let | ধরি | dhori | Declare a block-scoped variable. |
const | ধ্রুবক | dhrubok | Declare a constant value. |
function | ফাংশন | fankshon | Define a function. |
class | শ্রেণী | shreni | Define a class. |
extends | প্রসারিত | prosarito | Extend a class (inheritance). |
super | অভিভাবক | obhibhabok | Call the parent class. |
Operators / Type
English | Bangla | Banglish | Description |
---|---|---|---|
typeof | ধরন | dhoron | Get the type of a variable. |
instanceof | উদাহরণ_হিসেবে | udahoron_hisebe | Check if an object is instance of a class. |
in | মধ্যে | modhye | Check if property exists in object. |
of | এর | er | Used in for...of loops. |
void | ফাঁকা | faka | Evaluate expression without returning value. |
delete | মুছুন | muchun | Delete a property from object. |
Async / Generators
English | Bangla | Banglish | Description |
---|---|---|---|
await | অপেক্ষা | opekkha | Wait for an async operation. |
async | অসমলয় | osomoloy | Declare asynchronous function. |
yield | উৎপন্ন_করুন | utponno_korun | Yield value from generator. |
Miscellaneous
English | Bangla | Banglish | Description |
---|---|---|---|
this | এটি | eti | Current object context. |
new | নতুন | notun | Create a new instance. |
with | সাথে | sathe | Extend scope chain. |
debugger | ডিবাগার | dibagar | Invoke debugger breakpoint. |
static | স্থির | sthir | Define static property/method in class. |