Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
89 views

Using a library to make a navbar , i am clicking the logout button but it displays homepage after clicking and not the log inside the callback function passed in onClick . import hcOffcanvasNav from &...
Interview Benzatine's user avatar
-1 votes
1 answer
192 views

I need to sort an array of object by property with the following order. For the first item in the list: it is either Camel or Absolute For the second item in the list: it has to be Dream, For the ...
user7046311's user avatar
0 votes
1 answer
78 views

I wanted to run a filter or reduce operation on an array and remove all duplicate items from the array based on an attribute like 'name' in this example. The examples I see are iterating through the ...
user3294878's user avatar
-2 votes
2 answers
122 views

I need to replace All in s3data Emp_Id with the response data's values(expected output appended), ignore 0 and 1 in response they are not required. S3data is json data I can't use inbuilt function ...
dash's user avatar
  • 35
1 vote
1 answer
3k views

after install project with tailwind with the command npm create vite@latest my-project -- --template react and after config tailwind, I tried to run my project but I got this error. I tried to install ...
Mateus Guedes's user avatar
3 votes
1 answer
296 views

I am learning JavaScript, and I am coming from Java. A Java developer can easily evaluate the usefulness of an interface, because all known implementing classes are documented. Please click here to ...
Arial's user avatar
  • 581
2 votes
2 answers
86 views

I have an array of objects that look like this const input = [ {id : "1" , text: "ABC", value: "abc" }, {id : "2" , text: "DEF", value: "def"...
user avatar
2 votes
1 answer
550 views

I am using vitejs and typescript and I want to set the compile target to es2016, but it seems that, the class private fields aren't be compiled. class Task { #prepare() { // here should be compiled....
LCB's user avatar
  • 1,060
0 votes
1 answer
64 views

for (var index = 1; index <= 3; index++) { setTimeout(function() { console.log('after ' + index + ' second(s):' + index); }, index * 1000); } output: after 4 second(s):4 after 4 ...
Chris Chris's user avatar
1 vote
1 answer
537 views

// getData() function is returning null right now , but Actually I want to return a value after 1.5 seconds showData = (data) => { console.log("showing" , data) } ...
Devansh Chauhan's user avatar
-2 votes
1 answer
73 views

We all know about destructuring objects in ES6+ const myObject = {name: 'John', age: 30, eyeColor: 'brown'} const {name, age, eyeColor} = myObject ... is there a "cleaner" way to do the ...
anthony galligani's user avatar
0 votes
1 answer
553 views

var GoogleStrategy = require('passport-google-oauth20').Strategy; How can I use ES2017's way to write it? I try import GoogleStrategy from ('passport-google-oauth20').Strategy But it couldn't work ...
user avatar
1 vote
2 answers
56 views

I have 2 arrays. const history = [ { type: 'change', old: 1, new: 2 }, { type: 'change', old: 3, new: 4 }, ]; const contents = [ { id: 1, info: 'infor1' }, { id: 2, info: 'infor2' }, { ...
Tran Quang Hung's user avatar
0 votes
1 answer
347 views

My code works, but I was taught to bind 'this' to the event listener function. In my web component class constructor, I have a button in the shadow root. In the constructor I also added the click ...
ahpto's user avatar
  • 21
0 votes
0 answers
115 views

I'm quite new in the NodeJS world. I have a question : I'm trying to put a unit test with Jest in order to test this 'Service' with the 2 functions as below in the quotationService.js file : export ...
user1841787's user avatar
-1 votes
1 answer
1k views

I have a code in place which looks like this - mapFn={response => (response.data && response.data.map(secret => ({ label: secret.secretName, value: ...
uttamsingh888's user avatar
1 vote
3 answers
56 views

I have recently started learning more about coercion in Js and I have been going through the ECMAScript documentation for knowing more about it and how different cases are handled in Js. While doing I ...
Atharvn's user avatar
  • 31
0 votes
3 answers
38 views

I'm trying to filter an array of objects based off a property and also filter an array of objects within. Can I use filter within a filter to loop through and reduce the second array? Something like ...
Cameron's user avatar
  • 75
3 votes
1 answer
655 views

I'm referring to ECMAScript regular expression syntax defined in https://tc39.es/ecma262/#sec-regexp-regular-expression-objects. I checked how the following pattern matches in a regular expression via ...
BunnyJamless's user avatar
-2 votes
2 answers
127 views

I have an issue here where the code is quite heavy and quite hard to read imo. I've simplified the code as much as I can but I was wandering if there's a way to simplify this code even further? Or ...
Junaid Razaq's user avatar
3 votes
0 answers
2k views

I am facing a very strange issue. As soon as I updated my node to node 16 from 14 my tests stopped working and I get a complain like this: Error: at /src/api/v1/datastore/SearchesDatastore.ts:109:...
Learner's user avatar
  • 2,039
3 votes
0 answers
807 views

I recently upgraded my project to Angular 13, I noticed that the new ng-packgr 13 bundles in .mjs extension by default. I have lots of code that uses require() to import some static assets and files. ...
vp310's user avatar
  • 320
1 vote
1 answer
3k views

How can I import an external file (config.js) from within a webpack bundle? I have the following file-structure for local dev: /dist/ /index.html /plugin.js /src/ /index.ts /config.js ...
coemu's user avatar
  • 304
2 votes
2 answers
930 views

When I run this code in the chrome console, it shows the following: >new Date("1651214829629") Invalid Date >new Date(1651214829629) Fri Apr 29 2022 14:47:09 GMT+0800 (中国标准时间) >...
iabuaz's user avatar
  • 162
-1 votes
2 answers
312 views

compare headerObj(field_key) and dataObj(key) and form the result with label from headerObj const headerObject = [{ label: 'Code', field_key: 'code' }, { label: 'Worked Accounts', ...
Vishnu Shenoy's user avatar
1 vote
1 answer
1k views

I am trying to make a simple react-router. But it's not even working. If I don't include the <Routes> tag the page is blank. After including the <Routes> tag it is also not working. Please ...
Bharath Kannan's user avatar
1 vote
0 answers
281 views

I've tried to update packages in an angular project but I'm getting many errors like "Cannot find name 'window'". My tsconfig.json looks like this: { "compileOnSave": false, &...
Maxim's user avatar
  • 719
0 votes
0 answers
35 views

Can I have a class like this? class Human { constructor(name) { this.name = name; } someMethod() { this.hasBrain = true; console.warn(this.hasBrain); } } This is working and not ...
RocketJS's user avatar
0 votes
0 answers
1k views

I am working on an application where I am checking that user is off or on their location. I am using react-native-location-enabler package to check the location setting, it works fine but the problem ...
Jonas's user avatar
  • 71
0 votes
2 answers
424 views

I was searching a few libraries for scroll animations and I found a very good npm package called @ashthornton/asscroll and I wanted to use the same on my react project. But I am not been able to ...
Satyam's user avatar
  • 667
0 votes
0 answers
40 views

This is a more of a can it ever be done even with a parser like babel or anything type of question which i believe is allowed in SU. All just to make my code cleaner for Reducer and State in general; ...
Kivylius's user avatar
  • 6,647
-3 votes
1 answer
143 views

I have an array of objects. Each object has a "tag" property with an array list. The values in this list repeat from object to object. I would like to sum up "cost" and "...
DonkeySticks's user avatar
0 votes
1 answer
368 views

I'm new to Typescript and I've problems when I use import/export syntax in the browser. The terminal/compiler doesn't throw any kind of error. But google's console says: GET http://127.0.0.1:5500/...
hyden97's user avatar
  • 155
0 votes
1 answer
515 views

I am a beginner at typescript and I am using it in reactjs but I am getting errors. Could someone please help me with how to resolve this issue? Element implicitly has an 'any' type because expression ...
Jonas's user avatar
  • 71
0 votes
1 answer
32 views

I am actually trying to render an HTMLElement using template strings. The function goes like this function renderContent(){ return `<div class="card"> <span>...
user avatar
1 vote
2 answers
629 views

I'm working on a JavaScript function that can create an authors- H-Index. H-Index is the highest number of publication an author has written with just as many citations in other articles. I have let ...
Bill's user avatar
  • 1,517
1 vote
0 answers
24 views

I have a complete config object and another object that can be partially filled. When merging them, I need the unchanged settings to remain. let defaultConfig = { locale: 'en', messages: { ...
Yung Silva's user avatar
  • 1,551
4 votes
1 answer
298 views

In JavaScript We all know that {} !== {} - they are different objects allocated on heap. But I was trying to find the reason at the language specification level. at https://tc39.es/ecma262/#sec-...
Joji's user avatar
  • 5,846
0 votes
0 answers
721 views

I want to pass mapStateToProps value to next component while using withRouter so that i can maintain this.props.history also. Here is my code. import React from 'react'; import { connect } from 'react-...
Ankit Giri's user avatar
0 votes
3 answers
5k views

I have a simple auth form in my react-native app, but everytime the software keyboard appears, whole screen moves up and squishes everything together. I am desperate and unable to do anything about it,...
Pogasta's user avatar
  • 147
-1 votes
3 answers
60 views

I have a problem on an object inside of an array and I wanted to display only that as an array. data1 const data1 = [ { "id": "01", "info": "fefef", ...
Gray Singh's user avatar
-1 votes
1 answer
4k views

import React from 'react' import styled from "styled-components"; function Home() { return ( <Container> home </Container> ) } export ...
Pamod Akalanka's user avatar
0 votes
0 answers
582 views

I have been looking for the perfect library that does async requests in batched pools. I have looked at p-limit, tiny-async-pool and others but they all have the same limitation for what I am trying ...
Álvaro's user avatar
  • 2,678
0 votes
1 answer
148 views

Hi I have an array of keys Ex1: const arrWithKeys = ['a','b','c'] I want to use them as parameters because I don't want to write them multiple times, there is a way to achieve it?. Ex2: const [......
Barak's user avatar
  • 734
0 votes
0 answers
223 views

I'm using muidataTable to display some data,and i have to calculate a value that requires filtering by selected row and reducing the array. My code looks like: Array.filter(//mylogic(e)=> e....
Aymen Aymen's user avatar
1 vote
0 answers
832 views

I have a file called get.js with an exported function and an exported var within it: var a = false export function get(url) { return new Promise((resolve, reject) => { const xhr = new ...
BeHFaR's user avatar
  • 129
0 votes
1 answer
356 views

The first of the below code examples is what I am doing today, where I initialise the global variables in the constructor. But would there be any harm in moving the global variables out in the class, ...
Sandra Schlichting's user avatar
0 votes
0 answers
198 views

I am trying to write Cypress UI test automation in which I am capturing UI elements on each webpage in its own class. I have two classes corresponding to different webpages: class WebPage1 { ...
Rnj's user avatar
  • 1,199
0 votes
1 answer
66 views

Javascript newbie here. I have to write this using plain old Javascript. I have 2 inline edit components, only difference is that one uses icons instead of buttons. The issue I have is I wrote 2 edit ...
iosSicilian's user avatar
2 votes
2 answers
2k views

So, I found something I couldn't understand and can't find any internet resource that explains it. Please see the code below: var num = 35422484817926290 // subtract 5 from num console.log(num-5) ...
Kristie's user avatar
  • 142

1
2 3 4 5
10