Category "javascript"

javascript merge sort and recursion

I am trying to understand how JavaScript merge sort function work. And I struggle understanding how the recursive function work. This is the code: const mergeSo

Find max for an array, 0 if array is empty

I need a clean way of finding max for an array in JavaScript. Say it is arrayMax, then: arrayMax([]) // => 0 arrayMax([1], [2]) // => 2 arrayMax([-1]) //

ESLint - 'process' is not defined

I am using ESLinter for a simple node project. Below is the only code I have in index.js: const express = require('express'); const app = express(); app.get(

Why do IntersectionObservers created in a function continue to work after the function call finishes

Reading through the Mozilla Developer Network explanation of the IntersectionObserver, I encountered this section which is part of an example use case for the I

async await in switch case statement does not work

can we wait for the resolution of a promise within switch case statement, using the keyword await? in my angular component I have the following code which crash

firebase auth is not a function

I got this TypeError: WEBPACK_IMPORTED_MODULE_4__firebase.c.auth is not a function The line i got an error is the first line. firebase.auth().createUserWithEm

React Router changes the URL but doesn't rerender the component

I'm making a ReactJS websites, the problem is that when the user click on a <Link to="path"> the URL location changes, but the whole webpage becomes black

Add 2 Webcam in one page with WebcamJS

I'm trying to add 2 or multiple webcam input with webcam.js from jhuckaby. But only one will works perfectly. And i'm following this tutorial https://pixlcore.

Upload image to Firebase 9 storage with React?

I'm trying to make a simple input button that users can click to upload image (.png) files to Firebase-Storage (v.9) with React (for non-authenticated users). H

How can I prevent FilePond creating overlay for success, idle, and failure all at once?

I've enabled image preview for my FilePond component using the image preview plugin. However, when uploading an image the preview has overlays created for when

Prevent on click on parent A tag when clicking button inside

I have problems with product cards on index page. Inside product card I have Vue component to render form (quantity and add to cart button). When I click on add

How to parse a string to array in js

I have an a string like the following, var x = "[{"k":"1"}]"; console.log(x[0].K); I ant hange this string sine I am getting from the server.Its out of my co

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined raised when starting react app

I'm working on a project in React and ran into a problem that has me stumped. Whenever I run yarn start I get this error: TypeError [ERR_INVALID_ARG_TYPE]

Load local files into iframe in Electron app

I'm building an app with Electron that lets you preview HTML5 banner ads stored locally on your machine. So far, I have made it possible to select a directory c

Swiper.js slidesPerGroup or slidesPerView not grouping the odd items

I'm using Swiper.js for a slider on a website I'm building for a client. Their requirement is something like this: There are 10 items inside the slider, 4 will

node.js express-unless exclude a path from middleware.auth

I am looking to use express-unless to exclude a /health path from using middleware.auth. I am having syntax issues, and I am unable to test this locally. If I

Add Class in html Dynamically in PHP

I am trying to add class in anchor tag dynamically by using Java script or Jquery. I have find many solution but not what i am looking. I am want to use PHP dyn

failed to load response data request content was evicted from inspector cache

i am trying to get file from server that has size of(15mb) through Axios Request. showing status "200", but not sending file previewData(base64) and showing thi

Server responds with status 405

I'm running into a small issue with my "server". So while I'm trying to learn backend to frontend communication, I was messing around and trying to create an "a

Javascript / JQuery Contenteditable resize handles should set table column width parameter

I'm looking for a solution primarily supported by Webkit browsers (Chrome / Edge / Safari) that allows table columns to change the actual width of these columns