Learn JavaScript

lesson ২ / ৯ · this, prototype আর class

Module ৯ · this, prototype আর class

this-এর প্রতিটা নিয়ম, আর class syntax-এর প্রতিটা অংশ, একটা একটা করে

Account থাকলেই freeপড়া

Kenji একটা team নিয়ে দোকানের app বানাচ্ছে। এক teammate class লেখে, আরেকজন লেখে constructor function, তৃতীয়জন method পাঠায় timer-এ। এই সপ্তাহের প্রতিটা bug report বলছে "this is undefined", নয়তো "this.price is NaN"। নিয়মগুলো কঠিন না। শুধু কয়েকটা নিয়ম আছে, আর প্রতিটা call-এর ধরন একটা করে মেনে চলে।

আপনার জন্য এই lesson টা খোলা কি না দেখা হচ্ছে…

this-এর প্রতিটা নিয়ম, আর class syntax-এর প্রতিটা অংশ, একটা একটা করে এর ভেতরে কী আছে

  1. Method call
  2. Plain call
  3. call আর apply
  4. bind
  5. new
  6. Arrow-এর lexical this
  7. Object.create আর Object.getPrototypeOf
  8. Constructor function আর .prototype
  9. Class syntax: constructor আর method
  10. Class field
  11. static
  12. Getter আর setter
  13. extends আর super
  14. # দিয়ে private field
  15. instanceof
  16. class আসলে prototype-এর ওপর চিনির প্রলেপ
  17. যেখানে চিনির প্রলেপ ফাঁস হয়: method bind করা থাকে না
  18. কোন this পাব?