• Complain

Meet K Patel - Advanced JavaScript Visualized

Here you can read online Meet K Patel - Advanced JavaScript Visualized full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2021, publisher: Independently Published, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Advanced JavaScript Visualized
  • Author:
  • Publisher:
    Independently Published
  • Genre:
  • Year:
    2021
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Advanced JavaScript Visualized: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Advanced JavaScript Visualized" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Nowadays JavaScript became an essential programming language that no one ignores or avoids. There are thousands of ways of learning JavaScript but a proper mental model for the core JavaScript concept is the most important part. So, anyone who is truly passionate about web or JavaScript will always love to learn under the hood working JavaScript and nodejs architecture. This book will give you a strong foundation of advanced JavaScript concepts and explains the topics with plain English and visualization. Here are the content and topics that we will learn and visualize.

- Execution Context, Thread, and Callstack
- Closure - A Deep Dive
- ProtoType , __proto__ and Objects
- Asynchronous Execution
- Iterators, Generators, and Async-Await
- NodeJS, C++, Queues, and Servers
- Bonus

Hope you will enjoy the ride of this book and I will catch you inside the book.

Meet K Patel: author's other books


Who wrote Advanced JavaScript Visualized? Find out the surname, the name of the author of the book and a list of all author's works by series.

Advanced JavaScript Visualized — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Advanced JavaScript Visualized" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make

Meet Patel

Advanced JavaScript Visualized

Copyright 2021 by Meet Patel

All rights reserved. No part of this publication may be reproduced, stored or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise without written permission from the publisher. It is illegal to copy this book, post it to a website, or distribute it by any other means without permission.

Meet Patel asserts the moral right to be identified as the author of this work.

Meet Patel has no responsibility for the persistence or accuracy of URLs for external or third-party Internet Websites referred to in this publication and does not guarantee that any content on such Websites is, or will remain, accurate or appropriate.

Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book and on its cover are trade names, service marks, trademarks and registered trademarks of their respective owners. The publishers and the book are not associated with any product or vendor mentioned in this book. None of the companies referenced within the book have endorsed the book.

First edition

This book was professionally typeset on Reedsy
Find out more at reedsy.com

I like to dedicate this book to my engineering which made me realize I should have started writing earlier :)

The true sign of intelligence is not knowledge but imagination.

- Albert Einstein

Contents
1
Execution Context, Thread & Callstack
We all know that we always had and have a love and hate relationship with JavaScript from the day you or I started learning it. But, sometimes philosophy around those weird JavaScript concepts can easily be understood if we just dig down the basics and fundamentals.

This is the most important and fundamental chapter of all. So if you get this, then almost everything will be easy to follow and understand. Welcome to the exciting journey of JavaScript beyond normal expectations.

Terminologies

  • Memory
  • Processes and Threads
  • Execution Context
  • Scope
  • The Thread of Execution
  • Callstack
Memory:- A computer is just a machine that takes a set of instructions and executes it, but during that time computer needs to hold some information for the calculation or for any other task. So, we have storage devices like RAM and ROM (HDDs, SSDs) which hold information temporarily or permanently. So, memory is just a part where our information is held.Process:- A currently executing/running program (bundled up instructions) is called process. Each process is just a blueprint for what the computer needs to do in order to finish a given task.Thread:- A process is a set of instructions bundled up, but each instruction might need to be executed as well to achieve the original process to be finished and so the thread is just a simple lightweight running process (a small set of instruction/s in execution).Execution Context:- It's nothing but a currently running code inside memory(every running program needs memory) which could be normal function execution or normal JavaScript code like if-else, loop, or any other expression.Memory + Process == Execution ContextScope:- A Scope is an allocated memory to a specific or currently executing function or block of code. That is to say, variables(memory) is not available outside of it to functions or block of code.Scope == Memory Restriction/s for execution context/sThe Thread of Execution:- A currently running(executing) function or block of code is a thread of execution. That is to say, it is a small running process inside our main process.Callstack:- It's a container in which you can add or remove code block/functions such that most recently added stuff in this container will get priority for the next thread of execution. That is to say Last In First Out (LIFO) pattern.

Before we move further let me give you a quick overview of how processes are managed at a high level.

  1. Initially, any program(set of instructions) is collected by the memory(usually in the RAM) and then the processor takes the initiative to complete that program.
  2. A processor then take the program and start executing it and during that process processor might need to do extra stuff to accomplish a given task i.e. processor might perform a program inside the program(Set of instruction might need other instructions as well) AKA thread/s also needs to be done as well.
  3. After finishing the program, the Operating System will take care of the cleanup and some other dependent task/s.
  4. Now, any program is called single-threaded when the given program can perform a set of instructions one by one, and no extra internal set of instructions is done(Running JavaScript program is a single-threaded process).
* * *

After getting an idea about termonologies Lets now further understand stuff with a little example

Example 11 - First thing if you dont know then JavaScript is a - photo 1

Example 1.1

- First thing if you dont know then, JavaScript is a single-threaded and synchronous language which mean JavaScript engine/Interpreter can execute one line or block of code at one time. Which means you cant do multiple things at the same time. Also, you go through line by line while executing code (synchronously).

- when you execute JavaScript code on a browser or any other enviroment(nodejs, react-native etc) we run our code in something called global execution environment(global memory space for browser tab or global memory for node enviroment first).

- every function we defined are actually first goes inside global memory space (ignore function defined inside another functions for now). When we put these function into execution, first they are put on callstack first and from that callstack functions are getting called where latest function are made available in thread of execution!

- Before we start understanding the given code its important to create mental model for all the stuff we learned so far.

Current JavaScript Mental Model In our mental model we can see that every - photo 2

Current JavaScript Mental Model

  • In our mental model, we can see that every JavaScript program gets Global memory space (Global Scope). Every function and topmost declared variables are hoisted in the global scope.
  • Hoisting is JavaScripts default behavior of moving all declarations to the top of the current scope (to the top of the current script or the current function) - W3SCHOOL (I dont prefer w3school but sometimes it explains stuff easily).
  • Each line of code or function definition is not called directly in JavaScript. But instead, it goes to callstack, and then based on callstack current priority function/s is put in the Thread of execution (Last In First Out). Why not understand this mental model via example.
  • Lets start reading the below code and explore and keep the above mental model in mind.

Example 11 In the first line as you can see we are declaring a variable - photo 3

Example 1.1

  • In the first line as you can see we are declaring a variable called outerGoal and assigning a value of 0. That is to say, we are consuming small memory space inside global memory (scope) and giving the label called outerGoal to that memory.
  • In the next line of code, we are simply logging that value to the console. That is to say, we are simply logging value at a label called
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Advanced JavaScript Visualized»

Look at similar books to Advanced JavaScript Visualized. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Advanced JavaScript Visualized»

Discussion, reviews of the book Advanced JavaScript Visualized and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.