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