« first day (2666 days earlier)      last day (1451 days later) » 

 
3 hours later…
 
1 hour later…
11:32
let input = "A string with 3 numbers in it... 42 and 88.";
let number = /\b\d+\b/g;
let match;
while (match = number.exec(input)) {
console.log("Found", match[0], "at", match.index);

}

// → Found 3 at 14
// Found 42 at 33
// Found 88 at 40
1 message moved from JavaScript
 
1 hour later…
 
2 hours later…
14:52
got query here it is:
https://stackoverflow.com/questions/61770205/initialcontext-lookupjavacomp-env-fails
jndi lookup is working in windows but fails in linux please help
Zoe
Zoe
@shreeramaute Please don't use chat as fastlane for your questions. Instead, wait a few days before asking here to give the people on the main site some time. If we want to answer questions there, we will look for them on our own.
3 messages moved from Java
 
4 hours later…
19:24
navLink.forEach(function(button2) {
button2.addEventListener('click', function() {
//toggle active
for(let i = 0; i < navLink.length; i++){
if(this.id === navLink[i].id){
// contains active anywhere remove it
if ( this.id === toggleImg[i].id ) {
//remove from all
navLink.classList.remove("active"); //doesnt currently work
}
}
}
});
});
1 message moved from JavaScript
 
1 hour later…
Can anyone help me rewrite this?

const newData = {};
data.map((e) => {
newData[e.utc_time] = e.data_value;
});

I tried to write it functionally:

`const newData = data.reduce((obj, datapoint) => ({ ...obj, [datapoint.utc_time]: datapoint.data_value }), {});`

...but with 12000 items that's way too slow.
1 message moved from JavaScript
Can anyone help me rewrite this?

const newData = {};
data.map((e) => {
newData[e.utc_time] = e.data_value;
});

I tried to write it functionally:

const newData = data.reduce((obj, datapoint) => ({ ...obj, [datapoint.utc_time]: datapoint.data_value }), {});

...but with 12000 items that's way too slow.
1 message moved from JavaScript
21:54
Hello, I am trying to split up some results and then loop through each split set.

if(something){
object1['animals'] = results[i1];
}
If(something else){
object1['cars'] = results[i1];
}

$.each( object1['animals'], function(index,record){
record.key2 = "A";
});
$.each( object1['cars'], function(index,record){
record.key2 = "B";
});

but all records seem to have key2 = "B"
I thought each element would be separate but its acting like they are linked together? I am super lost.
1 message moved from JavaScript
gad
`if(something){
object1['animals'] = results[i1];
}
If(something else){
object1['cars'] = results[i1];
}

$.each( object1['animals'], function(index,record){
record.key2 = "A";
});
$.each( object1['cars'], function(index,record){
record.key2 = "B";
});`
if(something){
`if(something){`
` object1['animals'] = results[i1];`
`}`
`If(something else){`
` object1['cars'] = results[i1];`
`}`
`
`$.each( object1['animals'], function(index,record){`
` record.key2 = "A";`
`});`
`$.each( object1['cars'], function(index,record){`
` record.key2 = "B";`
`});``

« first day (2666 days earlier)      last day (1451 days later) »