Skip to content

Category: Questions

how to remove top or root class from child element

I am trying to transpile this scss to css input output expected output In my output .abc class added in all item . I want it should add only on top element ? how to remove .abc class from child element Answer It’s not possible using the parent selector. The only way I can think of is to store the

Javascript coding, combine the same object

data = [{a:1, b:2},{a:2, b:2},{a:2, b:2},{a:3, b:2},{a:3, b:2},{a:3, b:2}], we need to convert data array to data = [{a:1, b:2, count:1},{a:2, b:2, count:2},{a:3, b:2, count:3}] I used this code, but it seems the key to the map is deep comparison. so even with the same string value, I got different keys I als…

User to select certain numbers from prompt

I’m attempting to make the user select certain numbers from a prompt, the empty input returns the alert message but I have no clue how to go about getting an alert message when the user chooses a number that is less than 8 or more than 128. Thank you! Answer Your conditional is messed up. It needs to be…

How to convert svg polyline to bezier curve?

Trying to get cooresponding Bezier curve in path from svg polyline. Polyline: to Path: How to achieve this prefering using javascript otherwise python? Edit: i finaly work with big size then convert the polyline points to line L and then downsize on desired size, it’s look like curve and work for my nee…

Javascript Cannot access class before initialization

I have the following bit of code whereby I’m using class expressions But I’m getting the error Uncaught ReferenceError: Cannot access ‘ShapeOverlays’ before initialization on the line const overlay = new ShapeOverlays(elmOverlay); which is weird because the class has been initialized a…

TypeError: a.preventDefault is not a function

I’m trying to register auth with firebase using the name, email and password, but when I tried to register with that info then give me an error, like this: TypeError: a.preventDefault is not a function I’m sure my firebase connect is ok, because before I have save post data from this project, so, …