Skip to content
Advertisement

Tag: ecmascript-6

Reduce nested array maximum values to a single array

I am trying to find a way to reduce the max values of specific positions/indexes within nested arrays into a single array. Given: const myArr = [[105,87,171],[113,192,87],[113,87,87],[113,87,87]] Expected return value: [113,192,171] Actual return value: [113,87,87] Using the following code, I’m getting the above return value. Why am I only getting the max value for the first position, and not the

PostMessage Issues Using IFrame in JS

I have two buttons that work differently. The first one is when you click the reload button, it should reload the page. The second one is when you click it, it will show the alert on the page. I’m using postMessage because its inside the iframe. I’m not sure why the two buttons are not working but I already implemented

Show and Hide Condition in React

I have a simple problem here which I can’t figure out. I wanted to hide menus depending on the condition. For example if status contains at least one “Unlinked”. “All unlinked images” menu should appear. I did used .some and I wonder why it doesn’t return a boolean. Codesandbox is here Click here Answer The methods do return a boolean.

Advertisement