Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TechTalk - Advanced JavaScript concepts you mig...

TechTalk - Advanced JavaScript concepts you might need

JavaScript has evolved enormously over the years into a sophisticated language, bundled with numerous advanced features. The language has more than a handful of advanced concepts and APIs that are definitely useful but require the end developer to put in some real effort in order to understand them truly. In this talk, we'll explore all such advanced concepts and APIs. Start by getting our hands firm on the basics of JavaScript, and then continue exploring the Symbol, Promise, etc.

Marko Arsić

October 26, 2022
Tweet

More Decks by Marko Arsić

Other Decks in Programming

Transcript

  1. HypeTech Tech education and shaping ideas into hype products hypetech.io

    | reactweek.dev Marko Arsić Founder and CEO @ HypeTech Founder of HypeTech Education Lecturer @ ReactWeek.dev Independent Tech Consultant Helping companies set up teams and standardize the development process github.com/marsicdev
  2. JavaScript is a huge programming language. It runs on the

    client-side web browser platform where it powers HTML pages to be interactive, dynamic and responsive.
  3. JavaScript has evolved enormously over the years into a sophisticated

    language, bundled with numerous advanced features.
  4. The process by which the JavaScript language evolves starts with

    “champions” (folks who want to add/change something in the language) drafting a proposal document for what they want to add/change
  5. Generally these proposals are somewhat boring and are written in

    a very technical language almost without any formatting with lots of text just like this slide. Sometimes, any only sometimes they make nice slides and add emojis to help explain things. ✌👌💯
  6. S0 - (Strawperson) Just an idea. Looking for initial feedback.

    S1 - (Proposal) Looking for initial feedback. Has a “champion(s)” S2 - (Draft) More formalized spec. Likely has a Babel plugin. S3 - (Candidate) Basically done. Getting feedback from real users. S4 - (Finished) Done and is ready for acceptance into the ECMAScript.
  7. Depending on the runtime environment, the JavaScript engine offloads asynchronous

    processes, such as making network requests, file system access, and other time-consuming jobs, to some APIs to achieve asynchrony.
  8. We expect the result of an asynchronous operation to succeed

    or fail. The process can also take more time than anticipated, or you may no longer need the results when you receive them.
  9. It is logical to terminate an asynchronous operation that has

    taken more time than it should or whose result you don’t need.
  10. AbortController was introduced to address the above problem. It is

    for aborting certain asynchronous operations natively.
  11. In JavaScript, yield is used to pause the execution of

    a function. When the function is invoked again, the execution continues from the last yield statement.
  12. A function that yields values is a generator. A generator

    in JavaScript consists of a generator function, which returns an iterable Generator object.
  13. Generators can maintain state, providing an efficient way to make

    iterators, and are capable of dealing with infinite data streams, which can be used to implement infinite scroll on the frontend of a web application, to operate on sound wave data, and more…
  14. When used with Promises, generators can mimic the async/await functionality,

    which allows us to deal with asynchronous code in a more straightforward and readable manner.
  15. A generator function is a function that returns a Generator

    object, and is defined by the function keyword followed by an asterisk (*)
  16. Ordinarily, an asynchronous processes may succeed, fail, take longer than

    anticipated, or you may not need the results when you receive them. Cancel your promises
  17. Generators are processes that can halt and resume execution. They

    are a powerful, versatile feature of JavaScript, although they are not commonly used.
  18. Q & A As everything good in life, knowledge is

    great only when shared https://discord.gg/94uhCAkFKf