Skip to content

Tag: javascript

Creating an image from an svg is not working

I have been trying to create an image (using the window.Image class) out of an DataURL. This DataURL contains a svg tag and a foreignObject. But it just stays completely empty. I also tried to draw this image on a canvas, but I don’t think that’s the problem since I can’t even get a correctl…

Replace Loops using Recursion

I really need a feed back on my explanations especially on 2) and 3). I just want to confirm if I understood it correctly or no since I am a newbie. This is a freeCodeCamp challenge which was really challenging for me because I have no experience with JS before. It goes as below. Write a recursive function, s…

Having a hard time changing background color in Vue js

I’m trying to make the background color of the landing page orange, but the issue is that what I currently have makes all the pages orange. I tried adding scoped to the landing page so it would style only that page, but when I do this, the entire page isn’t orange anymore. The end goal is to only …

Compare arrays of Errors in Chai

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…

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