Category "javascript"

changing the width of h1

I have this code below that allows the text to fade in nicely. However, as you can see when I run it below, it doesn't show the entire text specified in the h1.

getting image src in fabricjs

hi i am using fabric js for image resize and and drag and drop. now i want active object src . so i try like this way canvas.on('object:selected', function (

Can we use object destructuring for useState() in reactjs hooks?

As from the documentation from Hooks in Reactjs, const [count, setCount] = useState(0); they use array destructuring. Can we use object destructuring in pl

AWS S3/IAM CORS/Prefetch error when Uploading Image

I'm having problems setting up an S3 and IAM so that I can upload media files to the bucket. I've been following a video (https://www.youtube.com/watch?v=yGYeYJ

NWjs - Building Angular 2 Desktop Apps

I am trying to build an Angular 2 Desktop App with NWjs. What is the entry point? Any examples of Building Angular 2 Desktop Apps with NW.js

How to paginate Cloud Firestore data with ReactJs

I'm working with Firebase - Cloud Firestore and at the moment I would like to paginate all the records available. I already have a list of records and what is l

get value when updated,outside of formik using useRef()

I'm trying to get the value of an autocomplete field outside of my formik component everytime it changes, and i did something like this: const formRef=useRef<

Use imports with string that comes from localStorage

I need to show/hide different menu based on rights that are send from database and saved in localStorage. Here is the imported menus import tripOrders from './t

How do I build one dynamic JSON object using data from two different async functions?

I need to build one JSON object with data that I scrape from a website in two different async functions, below is my current code: const cheerio = require("chee

Nodejs Socket hang up & ECONNRESET - HTTP post request from Meteor to Node js server

I am using a node server to handle all my push notifications services like gcm and apn. I have 2 different servers. One is running Meteor and another is runnin

React native randomly crashes with error 'Attempted to remove more RCTKeyboardObserver listeners than added'

My react native project on iOS simulator crashes randomly with this error when I open and close the ChatRoom screen, I guess it's a problem with the react nativ

Express js,mongodb: “ReferenceError: db is not defined” when calling a function

The code is set up this way: var express = require('express'); var router = express.Router(); var mongo = require('mongodb').MongoClient; function getData(){

Constant space, one pass, daily coding problem

This is the Daily Coding Problem: “Given a singly linked list and an integer k, remove the kth last element from the list. k is guaranteed to be smaller

Bootstrap collapse all accordions on button click

Is there a way to collapse/expand all accordions with a button click? I tried it with a simple button that removeClass active and addClass active but it did not

Create Phone Number coding challenge

Can someone explain me what wrong with my code below? Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those

Apple Pay JS - How to check if payment is already authorized

I'm implementing Apple Pay on my web app using Apple Pay JS API. Before creating a new ApplePaySession, how can I check that Payment is already authorized and t

Cannot query clipboard when running puppeteer in headless mode

The code below works when puppeteer runs with { headless: false } but fails when it's true. The error is DataError: No valid data on clipboard.. Why is this hap

How to create multiple node types with mdx in Gatsby?

I am trying to create multiple content types in Gatsby using mdx (instead of remark). I am having trouble sifting through old methods of handling remark and new

es6 import for side effects meaning

I was reading the es6 import statement reference on MDN. The syntax: import "my-module"; will import an entire module for side effects only, without importin

How do I return an error if value is undefined in Node/JavaScript?

I am running a query to return some data async function getIngress(namespace) { try { const result = await k8sIngressApi.listNamespacedIngress(namespace,