Skip to main content
Filter by
Sorted by
Tagged with
0 votes
3 answers
135 views

Given a JSON object which contains tags identified by {{, I need to find all matches in the payload and replace them. The following code works, but only returns the 1st match, and if I turn on the gim ...
David Garcia's user avatar
  • 2,720
0 votes
1 answer
50 views

I'm attempting to put together a basic test framework for a number of JS scripts that I've been provided. These all run on nashorn (JDK 11) without issue in their original habitat. I'm attempting to ...
BogStandard's user avatar
  • 2,451
0 votes
0 answers
84 views

I'm coding a type-safe class system using ES5 and JSDoc. At the most basic level, the problem boils down to adding a property to the constructor's returned instance type, while preserving the type ...
Shmookoff's user avatar
0 votes
1 answer
125 views

I wont to do I want to transpile TypeScript code with Private Class Fields to ES5 like when using TypeScript's private identifier. (I give up one or the other, it will be resolved soon. But I don't ...
sflow's user avatar
  • 1
1 vote
1 answer
215 views

Working on a web app for a specialized device that runs Android 10 (Webview uses Chromium <80). When I try to serve the app and test on the Android device, I get errors for using optional chaining ...
ianrose2k's user avatar
1 vote
0 answers
139 views

I have a doubt regarding, how hooks like useCallback() work when the variables, arrow functions, and states used in it and its dependency, are declared before and after the useCallback(). Note: The ...
jd singh's user avatar
1 vote
1 answer
66 views

I was going through "JavaScript the definitive guide" and I encountered this auxiliary constructor (below their Set definition): // Definition of Set, taken from chapter 9.6.1 function ...
Taofeek's user avatar
  • 53
1 vote
0 answers
131 views

I would like to transpile JS code which uses the Node 'buffer' to pure ES5 so it can run on Duktape (with Webpack and Babel). The code has been simplified in a test.js, which uses buffer and console: ...
Jean-Luc's user avatar
0 votes
0 answers
33 views

I am trying to write logic in ES5 (in BIRT) to assess if an employee has worked 10 days in a row. I have extracted the start dates but can't seem to get the logic to work as intended. If an employee ...
Jacquelyn Bloomfield's user avatar
0 votes
1 answer
125 views

In the project settings, you're able to set "ECMA Script" between nothing, "ECMA Script 5" and "ECMA Script 6". But I'm really confused as to what this actually does. I'...
Shaun Roselt's user avatar
  • 4,361
1 vote
0 answers
140 views

I have an app that I built using create react app. I just found out that it needs to support a very old browser (chrome 37). I was under the impression that by default create react app uses babel to ...
kat's user avatar
  • 5,980
0 votes
2 answers
269 views

In ES6 there is .constructor.name which can be used on any object to get its class name. Is there something in ES5 that can do that? (Note: Before commenters mention to upgrade the browser, etc., this ...
My1's user avatar
  • 505
0 votes
2 answers
73 views

Currently I have the following code - var questions = ['1', '2', '3', '4', ..., 'n']; var qAsked = []; // array of indexes of already asked questions // the code below is executed multiple times if (...
LA_'s user avatar
  • 20.5k
0 votes
0 answers
56 views

I noticed something while playing with Typescript's compiler options. (Typescript is irrelevant here, I'm just using it as a compiler much like babel) So, I have this code in .ts file (function () ...
cvass's user avatar
  • 33
1 vote
1 answer
171 views

I am working on a project for school and am almost finished with it. I need code.org to search through my database for Habits that occur on the day set. (Days of the week) then be put into a list and ...
Devom Brahmbhatt's user avatar
0 votes
1 answer
321 views

I use webpack and babel to convert ES6 to ES5 file javascript but it doesn't work. File code javascript contains many functions. This is file webpack.config.cjs: module: { rules: [ ...
James's user avatar
  • 31
0 votes
1 answer
115 views

I try to run Highcharts with IE11 but it crashes I load Highcharts from ES5 folder as told in the documentation. IE11 devtool console indicates that the Highcharts es5 code not seem to be valid ES5. ...
uran's user avatar
  • 33
1 vote
0 answers
640 views

I have tried this with two separate Vite setups for Shopify and I'm receiving the same problem. It's not liking the conversion to ES5, or it's not doing it at all and Shopify doesn't agree with it. ...
Sambuxc's user avatar
  • 510
0 votes
1 answer
846 views

I have(making) an Angular 12 (IE-compatible) project where a few of my dependencies in node_modules are non es5. In my understanding tsc doesn't do anything with node_modules and just starts to ...
Ashish Ranjan's user avatar
0 votes
0 answers
212 views

We have a ES5 project where we used the import-modules library to import all files of a directory and execute there run()-function that I am now migrating to ES6. ... import importModules from '...
CRoNiC's user avatar
  • 409
0 votes
0 answers
346 views

I do not have access to string interpolation in our javascript engine and I need to create a solution for replacing all items in a string with previously defined variables. This needs to also work ...
cw84's user avatar
  • 115
0 votes
1 answer
38 views

I am currently trying to migrate a project that uses a resourceManager. I tried to sketch the functionality in the picture below. It basicly made it easier to use the different services I needed. Now ...
CRoNiC's user avatar
  • 409
0 votes
1 answer
327 views

JS noob here: If a getter/setter with a particular name is used that is the same as a property's name that takes on a value, and in code that is in strict mode, will an error occur in ES5? Ex (where ...
mishar's user avatar
  • 455
1 vote
4 answers
187 views

I'm trying to sort only a subset of an array, the subset is a filtered version of that array, and I need the whole array (with the subset sorted ) as a result. Here is the main array : var data = [ {...
Sebastien Chemouny's user avatar
4 votes
0 answers
918 views

I am getting the following error when compiling my Next.js app (with Typescript) with the "npm run build" command. Type error: Type 'Set' can only be iterated through when using the '--...
Software Developer's user avatar
4 votes
5 answers
280 views

How to batch group of array elements in reference to another array of group size ? I tried below code. Code: var group_size = [1, 3, 5]; var elements = ['a','b','c','d','e','f','g','h','i','j','k','l']...
Learner's user avatar
  • 91
-2 votes
1 answer
84 views

var now = new Date(); var year = now.getUTCFullYear(); var month = now.getUTCMonth() + 1; var day = now.getUTCDate(); var hours = now.getUTCHours(); var minutes = now.getUTCMinutes(); var seconds = ...
Learner's user avatar
  • 91
-1 votes
1 answer
31 views

import re items = ["abc","def","a123","bgh5"] ele_list = ["dsdsd-vfvfv-abc.xyz.com", "lbebbe-fjhdhf-abc.xyz.com", "bdfhjd-bjsbjd-bgh5....
Learner's user avatar
  • 91
1 vote
0 answers
66 views

I have HTML files with script tags, containing either ES6 code or CDN links to modern JavaScript libraries (such as lodash). I need to have all the code in ES5, since it's required by the Prince ...
Eugene Barsky's user avatar
0 votes
1 answer
2k views

I have two banners that needs to be displayed when one of the divs exist on my HTML, I've made this script and it works perfectly. The problem is that I'm using GTM and it gives this error: "This ...
Awa's user avatar
  • 61
0 votes
2 answers
52 views

I have two Data formats and need to compare them. But the prbolem is in 2nd format the Day(Mon, Tue) is in value and in 1st format it is in Variable side, So how I can compare the day. I have to ...
Destiel's user avatar
  • 35
1 vote
5 answers
504 views

I have a an array of objects in this format: const myArray = [ { one: 'A', two: 'AB' }, { one: undefined, two: 'AB' }, { one: 'A', two: 'BC' }, { one: undefined, two: 'CC' }, ] ...
iCodeByte's user avatar
  • 681
0 votes
0 answers
108 views

I'm trying to deploy Nuxt.js (2) SSR app to Firebase Hosting/Functions. I'm able to do that, as long as I won't include nuxt.config.ts in functions/src/index.ts. However, I do have some setup there, ...
Daniel Danielecki's user avatar
1 vote
2 answers
767 views

I am in the process of converting some of the old ES5 projects to TypeScript. In these projects, there are old-style classes (functions) defined as follows (simplified examples): function MyClass(arg1)...
mg007's user avatar
  • 3,008
-1 votes
1 answer
121 views

I am having a nested object that looks like this. This contains nested arrays and objects inside it. It looks like this, const input = { result: { data: { groupMapper: [ { ...
user avatar
2 votes
1 answer
140 views

I'm writing some in-depth educational materials about the object model, constructor functions and class mechanisms in Javascript. As I was reading sources I found this statement that I took the time ...
Stefan Octavian's user avatar
0 votes
1 answer
156 views

I'm trying to mock a rest call in Cypress. This rest call should return a map as response, e.g.: cy.intercept('POST', 'path', new Map([['a', 'abc']]) The problem is that this will return an empty ...
Little Monkey's user avatar
1 vote
0 answers
60 views

According to ECMAScript Language Specification 262, for-loop has a return value. link : https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-runtime-semantics-...
tonynamy's user avatar
0 votes
1 answer
442 views

After installing packages e.g. lodash using npm install --save lodash, I am trying to add it to the top of the file. import _ from 'lodash'; console.log(add(10, 3)); When I start Live Server from VS ...
Богдан Гапоненко's user avatar
1 vote
1 answer
153 views

I am having an object that looks like this: const obj = { "cat1" : { id: "1", name: "Category1", tiles: [{ tileName: ...
user avatar
0 votes
1 answer
221 views

I'm trying to a create an internal library for work. All seems to be fine until I attempt to use in another project. The file extension in all of the import statements seems to have been removed ...
Dave Maison's user avatar
0 votes
4 answers
96 views

I'm trying to filter an array using 2 criteria : one is straigthforward (==1) and the other is an array. In the below example, i would want to filter : level = 0 or name comprises in ['B','S'] [ {id: ...
Sebastien Chemouny's user avatar
-3 votes
2 answers
82 views

When I put Character in prompt the character is printed... var myNumber = prompt("What is your Number"); var myName = prompt("What is your name"); if (NaN != myNumber) { document.write("My ...
Junaid Khalid'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
0 answers
68 views

Entry level. ES5 standard. I have built a module: import Person from './Person.js'; function Employer() { Person.call(this); this.randomMethod = function() { console.log('...
GHopper's user avatar
  • 387
0 votes
0 answers
934 views

I bought one digital persona 4500 and I want to know if it works with VueJs project ? If yes, can you let me know a tutorial where I can try to do it ? I have an error on importing the Fingerprint ...
Dani R's user avatar
  • 1
0 votes
1 answer
679 views

I am having array of objects that look like this const test = { a: { name: "A", selected: [1, 2, 3], display: [1, 2, 3] }, b: { name: "B", selected: [4, 5, 6], display: [4, 5, ...
user avatar
0 votes
4 answers
85 views

I am having an object that has the following structure const arr = [ {field: "f1", values: [{ count:1, value: "a"}, { count:2, value: "b"}] }, {field: "f2", ...
user avatar
2 votes
1 answer
312 views

Looking at JS Reserved words (MDN), it looks like new features are introduced in backwards-compatible manner, meaning var let = 0, async = 1, await = 2; is a valid expression, at least outside strict ...
pzmarzly's user avatar
  • 826
0 votes
1 answer
335 views

const obj = { uid: "893212", a: {name: "Down here!", uid: "1231"}, b: { c: {uid: "5965"}, name: "bud name", }, d: {name: "...
kiranbabu's user avatar
  • 117

1
2 3 4 5
38