r/javaScriptStudyGroup • • Sep 10 '22

Interesting react interview problem

2 Upvotes

1- on clicking each box it should change to the colour green
2- after all the boxes have been clicked and turned green, the boxes should revert back to their default colour in the order they were clicked on one by one

I also made a full video tutorial guide for its solution, you can have a look if you get stuck.
Link- https://www.youtube.com/watch?v=HPnGF2qIwWQ


r/javaScriptStudyGroup • • Sep 10 '22

How can I make a callback function that takes value from an input and put the value inside a backgroudColor instead using a switch statement for every color. Pardon my English is not good so I made a video to make it more understandable.

2 Upvotes

r/javaScriptStudyGroup • • Sep 05 '22

Optimized Search Filter in React Js | Filter, Debounce, Infinite Scrolling (Pagination) | All in one

2 Upvotes

As a frontend developer, one of the most common requirements in most projects is to build a search filter. But simply building a search filter isn't enough, You need to consider different design aspects and make sure to build a highly optimized search filter that improves the application performance as well as saves up the company some money through reduced network calls. One of the most popular ways to do this is by integrating the search filter with debounce and pagination. And these concepts even polish a lot of your JavaScript skills. If you are interested to learn how to implement something like that, here's a full tutorial/guide I have made on the same.

Link - https://www.youtube.com/watch?v=8TgMRJoUSMc


r/javaScriptStudyGroup • • Sep 05 '22

3D Rotating Image Gallery Using HTML, CSS And JavaScript |

Thumbnail
youtu.be
2 Upvotes

r/javaScriptStudyGroup • • Aug 25 '22

I have spent several hours working on this and cannot make it work.

2 Upvotes

Researchers have discovered that every 4 weeks a disease is killing 40% of the insect population after the population has reproduced. If 2 insects exist on the first week, how many weeks will pass until the insect population exceeds 10,000 insects? Write a

do-while

loop that outputs the insect population each week until the population exceeds 10,000 insects. Decimal places will appear in the number of insects after removing 40% of the population on week 4.


r/javaScriptStudyGroup • • Aug 19 '22

Is there a book like this for Javascript too?

2 Upvotes

r/javaScriptStudyGroup • • Aug 18 '22

Create JavaScript Calculator (Complete Code)

Thumbnail
tutorialstonight.com
2 Upvotes

r/javaScriptStudyGroup • • Aug 09 '22

Flatten an array

2 Upvotes

Ever wondered how to fatten an array in JavaScript using the reduce method? Check out this tutorial: https://www.youtube.com/watch?v=wqJchgHQTwo

If you want more practice, check out the full course here: https://www.udemy.com/course/cracking-the-javascript-coding-interview/?couponCode=03AFBAFA3BF8FF858384


r/javaScriptStudyGroup • • Jul 23 '22

How to stop the setTimeout or setInterval inside loop ?

2 Upvotes

The problem is When I click play button, I want to go through all the iteration(102) of while with certain delay(for visualisation purpose) until I click the pause button. If the pause button is clicked at iteration 73 execution, I want to stop at the current iteration(73) and save this step. Later, If the play button is pressed, I want to resume from the iteration(73/74) from where I left off. Variable curStp is used to monitor the current steps.

Currently, when the pause button is pressed, the loop is not stopping and it keeps going till it reaches 102.

let flag = 0;
const delay = 300;
const totalStps = 102;
var curStp = 0;

function mouseup() {
  let i = 0;
  console.log("Value of flag " + flag);
  while(i < totalStps - curStp) {
    const j = i;
    var timeout = setTimeout(function(){
       let stp = curStp;
       console.log("i " + i + "  j " + j + " curStp " + curStp);
       
       curStp = stp+1;   // this is done by setState.
       console.log("flag " + flag + " timeout " + timeout);
        }, delay * i);
        
    if (flag === 1) {
       console.log("break the loop");
       clearTimeout(timeout);
       // This is not stopping this setTimeout
       break;
    }
    i++;
  } 
}

function pause() {
  flag = 1;
  console.log("Value of flag in pause()  " + flag + " curStp " + curStp);
  let stp = curStp;
  curStp = stp;   // this is done by setState.
}

JSFiddle with setTimeout

let flag = 0;
const delay = 300;
const totalStps = 102;
var curStp = 0;

function mouseup() {
  let i = 0;
  console.log("Value of flag " + flag);
  while(i < totalStps - curStp) {
    const j = i;
    (function(i) {
    var timeout = setInterval(function(){
       let stp = curStp;
       console.log("i " + i + "  j " + j + " curStp " + curStp);
       
       curStp = stp+1;   // this is done by setState.
       console.log("flag " + flag + " timeout " + timeout);
        }, delay * i)
    })(i);
    if (flag === 1) {
       console.log("break the loop");
       clearInterval(timeout);
       // This is not stopping this setTimeout
       break;
    }
    i++;
  } 
}

function pause() {
  flag = 1;
  console.log("Value of flag in pause()  " + flag + " curStp " + curStp);
  let stp = curStp;
  curStp = stp;   // this is done by setState.
}

JSFiddle with setInterval


r/javaScriptStudyGroup • • Jul 18 '22

I need Help constructing my learning JavaScript programming Roadmap

2 Upvotes

I want to learn and master JavaScript to the fullest. I’m not just trying to learn how to build web apps.

I have a verity of learning resources: (codecademy-Udemy-Codewars)

I just need to know the best way to structure my resources in order to create a straight forward roadmap.

Subjects: Design Patterns in JS, OOP JS, Functional Programming in JS, Asynchronous JavaScript, and Asynchronous JavaScript.

Can somebody map these out in stages for me?

I don’t want to skip over any prereq prematurely

Thanx!!!


r/javaScriptStudyGroup • • Jul 14 '22

Create Decentralized JavaScript applications? Right now!

Thumbnail gridnet.org
2 Upvotes

r/javaScriptStudyGroup • • Jul 13 '22

Custom Date Picker using Vanilla JavaScript

2 Upvotes

Building a Custom Date Picker using Vanilla JavaScript can get you a lot of practical experience on many essential JavaScript concepts such as date formatting, event path in JavaScript, dom traversals and much more. So I decided to make an in depth guide/tutorial on it as well.
Here's a link to the tutorial if you are interested- https://www.youtube.com/watch?v=3CKk90bO9DY


r/javaScriptStudyGroup • • Jul 03 '22

3D Popup Card (Image) Using HTML And CSS |

Thumbnail
youtu.be
2 Upvotes

r/javaScriptStudyGroup • • Jul 02 '22

How react events are different from Javascript addEventListeners | Interview question

2 Upvotes

Recently I was asked about this question in an interview and didn't have enough knowledge to explain it in depth. After some research I finally understood the difference between react events and JavaScript addeventlisteners and when to use each of them based on the use case scenario in react. Its very important to understand the concept behind each of them and how they affect your application based on performance, and how "pooling" makes react events special. This 3 minute video explains everything you need to know.

Link: https://www.youtube.com/watch?v=pXR86JNulw0


r/javaScriptStudyGroup • • Jun 22 '22

Increase your node.js application by running in cluster-mode 🕑

2 Upvotes

r/javaScriptStudyGroup • • Jun 20 '22

Hashnode

Thumbnail
itsvinayak.hashnode.dev
2 Upvotes

r/javaScriptStudyGroup • • Jun 12 '22

HELP!! i need print out a statement for each age.

2 Upvotes

hello eveyone i'm stuck. I know this has got to be right underneath my nose but I can't figure it out. Ive been at it for hours. I need to print out a message for each age in the array below that determines if that age is under 18 or 18 and over. what am i missing or what am i doing wrong so far?

var ages = [17, 20, 34, 18, 16, 65, 49, 10, 22, 18];

for (var i = 0; i < ages.length; i++){

console.log(ages[i]);

}

any help would be appreciated!!!


r/javaScriptStudyGroup • • Jun 07 '22

Customisable Toast Notification using JavaScript

2 Upvotes

I built a highly customisable toast notification using vanilla JavaScript that allows user to control the position, type (success or error), message content, and duration of display of the toast notification. I learnt a lot of important JavaScript concepts while building this project, and I highly recommend you to try it out as well. Here's a video explanation of building the project from scratch
Link: https://www.youtube.com/watch?v=jJCUnPd1ymk


r/javaScriptStudyGroup • • Jun 06 '22

JavaScript help: So, I have to explain this random code tomorrow afternoon and I am honestly a bit confused and wanted to know if anyone could possibly help explain this to me.

Thumbnail
gallery
2 Upvotes

r/javaScriptStudyGroup • • Jun 03 '22

map function implementation from scratch in Js

Thumbnail
youtu.be
2 Upvotes

r/javaScriptStudyGroup • • Jun 02 '22

Maps in detail | JavaScript

2 Upvotes

Many people get confused between when to use a map or an object in JavaScript. While I have seen many developers use objects usually, there are a lot many instances where maps would have been more suitable. So I decided to make a video explaining maps in detail, its differences between objects and when to use one over the other under 8 minutes.
Link: https://www.youtube.com/watch?v=JRiVyaA2YKw


r/javaScriptStudyGroup • • May 26 '22

JavaScript Age Calculator from Date of Birth

Thumbnail
codemediaweb.com
2 Upvotes

r/javaScriptStudyGroup • • May 16 '22

Sliding Text Animation Using HTML And CSS Only |

Thumbnail
youtu.be
2 Upvotes

r/javaScriptStudyGroup • • May 10 '22

Features Of Spring Framework

Post image
2 Upvotes

r/javaScriptStudyGroup • • Apr 29 '22

I'm having an issue with my code

2 Upvotes

I'm trying to code a keybind. I'm able to run a key press and I'll get the desired movement but when I try to apply a keybind it breaks