My Java Full Stack Journey Learning in JavaScript

What is synchronization in javascript

Each line of code waits for the previous one to finish before proceeding to the next

Example:

<script>
console.log(“hii”);
console.log(“hello”);
console.log(“how are you”);
</script…


This content originally appeared on DEV Community and was authored by Dinesh G

What is synchronization in javascript

Each line of code waits for the previous one to finish before proceeding to the next

Example:

<script>
      console.log("hii");
      console.log("hello");
      console.log("how are you");
</script>

o|p:

hii
hello
how are you

what is asynchronization in javascript

To allow multiple tasks to run independently of each other line asynchronization.

Example:

<script>
      console.log("hi");
        setTimeout(()=>{
            console.log("hello");
        },2000);
        console.log("end");
</script>

o|p:

hi
end
hello

what is Call be Hell

As more nested callback are added the code becomes harder to read to read maintain and reason about.

Example:

<script>
function task 1(call back )
set timeout(()=>{
    console.log("task");
   },1000);
set timeout(()=>{
  console.log("plan");
   },1000);
</script>

Promise

A JavaScript Promise represents the eventual completion (or failure) of an asynchronous operation and its resulting value. It allows you to write asynchronous code that is more readable and manageable than traditional callback-based approaches, avoiding "callback hell.

Eg:

const my promise = new promise (resolve,rejected)=>{
                   resolve();
                  }

types

.pending
.resolved - operation completed successfully
.rejected - operation failed

Happy coding...


This content originally appeared on DEV Community and was authored by Dinesh G


Print Share Comment Cite Upload Translate Updates
APA

Dinesh G | Sciencx (2025-09-05T18:28:23+00:00) My Java Full Stack Journey Learning in JavaScript. Retrieved from https://www.scien.cx/2025/09/05/my-java-full-stack-journey-learning-in-javascript-5/

MLA
" » My Java Full Stack Journey Learning in JavaScript." Dinesh G | Sciencx - Friday September 5, 2025, https://www.scien.cx/2025/09/05/my-java-full-stack-journey-learning-in-javascript-5/
HARVARD
Dinesh G | Sciencx Friday September 5, 2025 » My Java Full Stack Journey Learning in JavaScript., viewed ,<https://www.scien.cx/2025/09/05/my-java-full-stack-journey-learning-in-javascript-5/>
VANCOUVER
Dinesh G | Sciencx - » My Java Full Stack Journey Learning in JavaScript. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/05/my-java-full-stack-journey-learning-in-javascript-5/
CHICAGO
" » My Java Full Stack Journey Learning in JavaScript." Dinesh G | Sciencx - Accessed . https://www.scien.cx/2025/09/05/my-java-full-stack-journey-learning-in-javascript-5/
IEEE
" » My Java Full Stack Journey Learning in JavaScript." Dinesh G | Sciencx [Online]. Available: https://www.scien.cx/2025/09/05/my-java-full-stack-journey-learning-in-javascript-5/. [Accessed: ]
rf:citation
» My Java Full Stack Journey Learning in JavaScript | Dinesh G | Sciencx | https://www.scien.cx/2025/09/05/my-java-full-stack-journey-learning-in-javascript-5/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.