Category "javascript"

What is the difference between Array.from(Object) and [...Object]? [duplicate]

There are these two ES6-methods of creating an array from an array-like or iterable object: Array.from(): let arr = Array.from(Object); Spre

How to display distance in AR.JS

https://m.youtube.com/watch?v=biCKHVefIe8 How to show distance in location based ar.js in JavaScript like this? I build a-image and I want to show something lik

Module "pretty-format" has no exported member 'CompareKeys'

import type { CompareKeys } from 'pretty-format'; ../node_modules/jest-matcher-utils/node_modules/jest-diff/build/types.d.ts:7:15 - error TS2305: Module '"prett

JS How can I increase the performance of this Max/Min coding challenge?

I'm trying to solve some 'hackerrank.com' coding challenges. I'm stuck on this one: You will be given an array of integers arr and a single integer k. You must

Prompt login via saved google account

I know how to integrate "Login via google account" in any website. But in some website like zomato always prompt "login via google" account while opening. It sh

How to detect if a variable is a pure javascript object

I have a function I need to pass an object to. I use typeof operator to make a check before processing. But looking at this link, it appears that many javascrip

Is it possible to extend the borders of table data <td> to align with content that has been moved via negative margins?

I have a collapsible table, which opens and closes when clicking on Accounting. It requires a unique layout. I have added a checkbox to my collapsible rows, w

How to get rid of the CORS error when sending email with attachments with Gmail API?

I know there are plenty of articles on the topic but none of them helped me solve this issue. I have a website where users can connect their Gmail account and m

How to get indexOf proper className of targeted element? [closed]

I have an target element which is a SVG which has two properties baseVal and aniVal, So I'm trying to get the proper indexOf the className fro

Jest: TypeError: replaceAll is not a function

String.prototype.replaceAll() is a useful method and while building and executing everything works fine. However, all Jest-tests fail with the following error:

Getting table name from cell selection in Apple Numbers using Javascript for Automation (JXA)

I'm trying to convert this Applescript to Javascript for Automation. Is there anyone who can help to write the line bellow in Javascript for Automation? set thi

Some instances of a ReactJS component won't update

I'm developing a VOD app for TV and I'm having an issue with updating an element inside of a slide component. Basically, when a costumer focuses on any of the s

Animate component unmount fade-out in React Native

On a React Native application, given a condition is true I should render ComponentA, else ComponentB should be visible instead. const ParentComponent = () =>

sending props to @react-navigation/drawer component

I am trying to send prop to component inside Drawer.Screen. I am using @react-navigation/drawer. I finally send props to navigation container but I cant send pr

Swiper slider: slide change to other div

I have created a parallax slider but I have one big problem with changing the slider. I can change the slider when my mouse is inside the blue zone As you coul

Audio recorded from Chrome doesn't play on Safari

I'm building an app using React Js where it can record audio from users, upload the file or blob to cloud storage, and play the recorded audio from the file URL

Performance of getElementById vs. getElementsByClassName vs. querySelector

I was reading about dom manipulation topic in dev.mozilla and I came across with a statement that suggest us to use querySelector for element selection: Not

node.js req.body returning undefined

EDIT: @LawrenceCherone solved this, its (req, res, next) not (err, res, req) I am creating a MERN app (Mongo, express, react, node). I have some routes that wor

Error: The type cast expression is expected to be wrapped with parenthesis when using get function

im new to javascript and im trying to make a get request to a youtube API. I have preconfigured a few things related to the request before making it using axios

Ethereum - insufficient funds for intrinsic transaction cost

I'm trying to create my own NFT contract factory, but it fails in mainnet. I have ETH on my wallet. In test it works fine. Here's my contract: //Contract based