Promises in JavaScript: Def, Creation, Call, Pros and Cons, Behind-the-Scenes Work, Real world Example

Definition Promises in JavaScript Promises state Prmises Method Resolve & reject Real World Example of Promises Question Related to About topic

In the dynamic realm of JavaScript, promises stand as a pivotal concept, transforming the landscape of asynchronous programming. This comprehensive guide will navigate you through the intricacies of promises, covering everything from their definition and creation to the call stack and beyond. Understanding Promises in JavaScript Defining Promises At its core, a promise is an … Read more

Most Aksed Interview Javascript Question (Closure)

Most asked interview question 2023 javacrpitsasd

Question aksed in Inteview : you have to write an Javscript code to print number in increasing order in each 1 secound differ or print num like at 1 sec- 1 , 2 sec -2 , 3 sec -3 … n sec -n. sr Time out Output 1 1 1 2 2 2 3 3 … Read more

Global and Local Variables in Javascript

creation of the execution context

Hello, It is our 2nd day of learning Javascript, if you come directly here please check out how the javascript is executing in the backend, how the call stack is created how the Execution context is created, and the flow of execution. in the simple word if you created the function and assigned the variable ( eg. var n=10) inside … Read more

JavaScript : Execution Context ,Call Stack ,JavaScript Execution ?(Important to Understand)

JavaScript Execution Context ,Call Stack ,JavaScript Execution

Hello Guys, It is your first day to start the javascript. Everyone Directly starts Javascript by learning the syntax rather than what is happening in the backend and how the javascript works. So, in this blog, we are looking at how the javascript works in the backend. Important Quote I Heard on the Internet : … Read more

Leetcode 342. Power of Four (Easy)

Leetcode 342. Power of Four

LeetCode 342. Power of Four :Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Power of Four” or “LeetCode 342. Method we are using are Mathematical approach and Bit Manipulation. Approach : Mathematical Line Explanation n x fmod(x, 1.0) Output 1 Check if n <= 0. 16 – … Read more

LeetCode 1793. Maximum Score of a Good Subarray (Hard)

LeetCode 1793. Maximum Score of a Good Subarray

LeetCode 1793. Maximum Score of a Good Subarray :Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Maximum Score of a Good Subarray” or “LeetCode 1793. ‘ Appraoch : Two Pointer dry run of the given code with the example ‘A = [1,4,3,7,4,5]’ and ‘k = … Read more

LeetCode1425. Constrained Subsequence Sum (Medium) – DP + Heap Appraoch

1425. Constrained Subsequence Sum

LeetCode 1425. Constrained Subsequence Sum :Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Constrained Subsequence Sum” or “LeetCode 1425. ‘ Approach: Dynamic Programming with a Heap table representing the step-by-step calculation of the example with the input array nums = [10, 2, -10, 5, 20] … Read more

Leetcode 1361. Validate Binary Tree Nodes (Medium)

1361. Validate Binary Tree Nodes

In the world of competitive programming, Leetcode stands as a ubiquitous platform where aspiring developers and programmers sharpen their skills. It offers a wide array of problems that challenge your ability to think critically and come up with innovative solutions. One such problem is Leetcode 1361 – “Validate Binary Tree Nodes.” This problem not only … Read more

LeetCode 353. Snake Game – Medium

LeetCode 353. Snake Game

Introduction LeetCode 353. Snake Game :Are you ready to dive into the world of game design and programming? In this blog post, we’ll be exploring a fascinating journey of designing a classic snake game while tackling LeetCode 353. Get ready to embark on this adventure with us! Understanding LeetCode 353 – Design Snake Game Before … Read more

Leetcode 2742. Painting the Walls

Leetcode 2742. Painting the Walls

Leetcode 2742. – Painting the Walls:Welcome to the world of dynamic programming, where we tackle complex problems with elegant solutions. Today, we’re diving into the intriguing challenge of Leetcode 2742. – Painting the Walls. This problem, while seemingly simple, can be quite tricky to solve efficiently. We’ll guide you through the process step by step, … Read more

leetcode 1095. Find in Mountain Array (hard)

1095. Find in Mountain Array

Welcome, fellow coding enthusiasts! Today, we’re going to embark on an exciting journey into the world of Leetcode and explore the fascinating problem of “leetcode 1095.” or “Find in Mountain Array.” In this blog post, we’ll break down this problem, guide you through the concept of Mountain Arrays, and provide a solution to tackle it. … Read more

Leetcode 53. Maximum Subarray (Medium)

LeetCode 53. Maximum Subarray

LeetCode 53. Maximum Subarray :Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Maximum Subarray” or “LeetCode 53. ‘ There are various approach to solve “Maximum Subarray” problem . we discuss three main approach which are optimaized – Kedane algo , Dp , Divide and conquer … Read more

LeetCode 1420: Build Array Where You Can Find The Maximum Exactly K Comparisons

LeetCode 1420 Build Array Where You Can Find The Maximum Exactly K Comparisons

LeetCode 1420. Build Array Where You Can Find The Maximum Exactly K Comparisons :Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Build Array Where You Can Find The Maximum Exactly K Comparisons” or “LeetCode 1420 ‘  Understanding the Challenge Before we delve into the … Read more

LeetCode 343. Integer Break (Medium)

LeetCode 343. Integer Break (Medium)

Welcome, dear readers! Today, we’re diving deep into the world of integer breaks and taking on the intriguing challenge posed by LeetCode 343 Integer Break. If you’re new to coding or a seasoned programmer looking to enhance your problem-solving skills, you’re in the right place. 🤔? So, what’s the deal with “Integer Break,” and why … Read more

LeetCode 229. Majority Element II (Medium)

229. Majority Element II

Leetcode 229. Majority Element II:Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Majority Element II” or “LeetCode 229. ‘  Method : HashMap Approach – Majority Element II 1: Initialize Data Structures 2: Count Element Occurrences 3: Calculate the Threshold 4: Iterate Over Counts 5: … Read more

Leetcode 706. Design HashMap (Easy)

Leetcode 706. Design HashMap (Easy)

Leetcode 706. Design HashMap:Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Design HashMap” or “LeetCode 706. ‘  Codes : Leet code 706. C++:Leetcode 706. Java: Leetcode 706. Python: Leet code 706. Leetcode 1359 Count All Valid Pickup and Delivery Options (HARD) JavaScript: Leet code … Read more

Leetcode 1512. Number of Good Pairs (easy)

Leetcode 1512. Number of Good Pairs

Leetcode 1512Number of Good Pairs:Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Number of Good Pairs” or “LeetCode .1512‘  First Approach : bruteforce (Looping) -Number of Good Pairs The Bruteforce is simplest approach ,we used .The Looping approach contain two loops and … Read more

Leetcode 2038. Remove Colored Pieces if Both Neighbors are the Same Color

Leetcode 2038. Remove Colored Pieces if Both Neighbors are the Same Color

Leetcode 2038. Remove Colored Pieces if Both Neighbors are the Same Color:Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Remove Colored Pieces if Both Neighbors are the Same Color ” or “LeetCode .2038‘ Greedy Appraoch : Leetcode 2038. Remove Colored Pieces if Both Neighbors … Read more