I have a validator method that returns an array with Errors. I want to create a unit test that compares this errors, but I can’t use expect(fn).to.throw since I don’t throw the errors, just return them. This is my approach but I get AssertionError: expected [ Array(2) ] to have the same members as…
Searching nested object by property name and copying to new object does not result in all objects being copied
Link to TS Playground. I’m trying to find all arrays with objects that contain the property name no matter how nested the initial data object is; and for some reason the final result only contains 1 result instead of all of them. When I debug at line 45 with I can see that it finds all objects; all 3 of
Need to select text of selected dropdown using JavaScript
I have a dropdown with values. I have an array array with a list of values that will match the drop down values. If the value of text option of the dropdown exists in the array, it shouldn’t show in the dropdown as an option. I am stuck on the approach I should use. This is what I have so
Break array of objects into 2dimensional array
I need to break an array of objects into a 2-dimensional array where 1-dimensional arrays would consist of objects which have their attributes ‘for’ and ‘to’ being not overlapping intervals. Example: Given array arr1 I wish to receive arr2 How it should work: We loop through the arr1. …
Switching to JSON data in AmCharts not working
New user to Amcharts (and programming!) and was trying to use one of their examples (https://codepen.io/team/amcharts/pen/gOpWroQ), but when I pull the data from and external JSON file, it doesn’t work properly. The JSON structure and format is correct and I literally copied the data from the JSON file …
Match based on a field only with non-empty array
I am trying to do a filter on something. Here is a simplified layout of my Order model: I want to query the documents based on the ingredients that they contain. I have an array of items to search through “objectifiedIngredients”. If it has ingredients in it, then I want to search for orders that …
my friend and I have a problem in js and html, we cannot make a 3d model out of a button
(sry for bad eng, we are from Moskow and we are stupid D) We have a problem, so to speak: quation. I with my bro write sam any code on HTMl, JS. and we must make 3d model wiht interactive button, …
Change text color of a ternary operator’s expression to red or green depending on which one is executed
I’m very new to Javascript and I’ve been stuck on this problem for a few hours now and I cant seem to find out how to solve the problem. Is there a way to have the ternary operator output “$” with green text or “-$” as red text? The way I have it set up right now will check…
I want to fix clicking menu button problems
To hide the menu when I click on windows or scroll, I tried like this. My html is like this. And css is like this. If you try this code, you can find when you click window once, then the button doesn’t work. When I click windows once, dropdown showed when I click the button twice. I want to solve
Bootstrap Card Render Problem in Google Chrome
Hello I tried to populate Bootstrap cards in a JSP file, but there is this rendering issue with chrome, where card becomes invisible. It works fine in firefox. I have tried inspecting the elements, it was fine. But when I try to scroll down, the card vanishes. Please help me how to resolve this issue. Here is…