Arrow functions revisited#168
Conversation
| - ...এছাড়া আরো অনেক ক্ষেত্রে। | ||
|
|
||
| It's in the very spirit of JavaScript to create a function and pass it somewhere. | ||
| অনেক সময় আমাদের কোন ফাংশন লিখ তা অন্য কোন কন্টেক্সে ব্যবহার করতে হয়। |
There was a problem hiding this comment.
Please change: অনেক সময় আমাদের কোন ফাংশন লিখ তা অন্য কোন কন্টেক্সে ব্যবহার করতে হয়।
to অনেক সময় আমাদের কোন একটি ফাংশন লিখে তা অন্য আরেকটি ফাংশনের কন্টেক্সে ব্যবহার করতে হয়।
| অনেক সময় আমাদের কোন ফাংশন লিখ তা অন্য কোন কন্টেক্সে ব্যবহার করতে হয়। | ||
|
|
||
| And in such functions we usually don't want to leave the current context. That's where arrow functions come in handy. | ||
| এবং এসব ক্ষেত্রে আমরা ফাংশনটিকে কারেন্ট কন্টেক্স কল করতে চাই। এক্ষেত্রে অ্যারো ফাংশন আমাদের অনেক সুবিধা দেয়। |
There was a problem hiding this comment.
Please change: এবং এসব ক্ষেত্রে আমরা ফাংশনটিকে কারেন্ট কন্টেক্স কল করতে চাই। এক্ষেত্রে অ্যারো ফাংশন আমাদের অনেক সুবিধা দেয়।
To : এবং এসব ক্ষেত্রে আমরা ফাংশনটিকে কারেন্ট কন্টেক্সে কল করতে চাই। এক্ষেত্রে অ্যারো ফাংশন আমাদের অনেক সুবিধা দেয়।
|
|
||
| ```warn header="Arrow functions can't run with `new`" | ||
| Not having `this` naturally means another limitation: arrow functions can't be used as constructors. They can't be called with `new`. | ||
| ```warn header="`new` এ সাথে অ্যারো ফাংশন রান করে না" |
There was a problem hiding this comment.
Please change: new এ সাথে অ্যারো ফাংশন রান করে না"
To : new এর সাথে অ্যারো ফাংশন রান করে না"
|
|
||
| ```smart header="Arrow functions VS bind" | ||
| There's a subtle difference between an arrow function `=>` and a regular function called with `.bind(this)`: | ||
| অ্যারো ফাংশন `=>` এবং ্রেগুলার ফাংশন `.bind(this)` এর মাঝে একটি পার্থক্য আছে: |
There was a problem hiding this comment.
Please change: অ্যারো ফাংশন => এবং ্রেগুলার ফাংশন .bind(this) এর মাঝে একটি পার্থক্য আছে
To: অ্যারো ফাংশন => এবং রেগুলার ফাংশন .bind(this) এর মাঝে একটি পার্থক্য আছে
| That's great for decorators, when we need to forward a call with the current `this` and `arguments`. | ||
|
|
||
| For instance, `defer(f, ms)` gets a function and returns a wrapper around it that delays the call by `ms` milliseconds: | ||
| ডেকোরেটার্সের জন্য এটি দারুণ, যখন আমাদের `this` এবং `arguments` এর সাহায্যে একটি ফরওয়ার্ড কল করতে হয়। |
There was a problem hiding this comment.
Please dont mention decorators as ডেকোরেটার্স rather use ডেকোরেটর ফাংশন or in plurals ডেকোরেটর ফাংশন গুলোর
| ``` | ||
|
|
||
| The same without an arrow function would look like: | ||
| অ্যারো ফাংশন ছাড়া ডেকোরেটার্সটি দেখতে এমন হত: |
There was a problem hiding this comment.
update this line following the last comment regarding decorators
| ``` | ||
|
|
||
| Here we had to create additional variables `args` and `ctx` so that the function inside `setTimeout` could take them. | ||
| এখানে আমাদের `setTimeout` ফাংশনের কন্টেক্সট এর জন্য আলাদা দুটি `args` এবং `ctx` ভ্যারিয়েবল লাগছে। |
There was a problem hiding this comment.
Please change to: এখানে আমাদের অতিরিক্ত ভেরিয়েবল args এবং ctx তৈরি করতে হয়েছিল যাতে setTimeout-এর ভিতরের ফাংশন সেগুলোকে ব্যবহার পারে।
| - এছাড়াও এর `super` নাই, এ ব্যাপারে আমরা এখনো পড়িনি। এই অধ্যায়ে বিস্তারিত জানতে পারব <info:class-inheritance> | ||
|
|
||
| That's because they are meant for short pieces of code that do not have their own "context", but rather work in the current one. And they really shine in that use case. | ||
| এটি দ্বারা বোঝায় অ্যারো ফাংশনের নিজস্ব কোন "context" নাই, তবে "current context" এর সাথে কাজ করে। এধরণের ক্ষেত্রে এরা আসলেই সুবিধাজনক। |
There was a problem hiding this comment.
Please change to: অ্যারো ফাংশন মূলত কোডের ছোট ছোট টুকরো। যা নির্দিষ্ট একটি কাজ করতে পারে। যেগুলির নিজস্ব context নেই, বরং current context এ কাজ করে।
jaamaalxyz
left a comment
There was a problem hiding this comment.
Please follow the guidelines and resolve all the change requests. appreciate your hard work.
|
Please make the requested changes. After it, add a comment "/done". |
No description provided.