Skip to content

Category: Questions

I want to decompress a GZIP string with JavaScript

I have this GZIPed string: H4sIAAAAAAAA//NIzcnJVyguSUzOzi9LLUrLyS/XUSjJSMzLLlZIyy9SSMwpT6wsVshIzSnIzEtXBACs78K6LwAAAA== I created that with this website: http://www.txtwizard.net/compression I have tried using pako to ungzip it. The issue is that Pako throws the error: incorrect header check What am I missing…

Javascript SetMonth Issue

I am doing unit tests. On my local node process I get this error On docker node process it works. I believe it is related to the DST, but I don’t understand how… Answer You’re right that DST is coming into play, because you’re using the local time setMonth/getMonth methods, so DST come…

options.domAPI is not a function

I’ve tried adding stylus config of Vuetify to modify the global variables, until I noticed that it’s not supported anymore. I’ve run this command to install the required loaders: npm i –save-dev stylus stylus-loader css-loader style-loader. After that, I started getting the error in th…

BlackJack game in JavaScript

I was given this challenge for an interview process and I have been trying to solve it correctly. On the console, the function returns undefined and sometimes just runs until (samPoints += getRandomCard()); Would you help me identify what I am doing wrong? These are the instructions: Model the game create a s…

How to prevent dragging of an element inside a ?

I am building an editor that uses an SVG element as the canvas. It provides custom drag-and-drop behavior to drag elements inside the svg around. However, when I try to drag an <image> tag, the native browser drag behavior where you’re dragging a “ghost” of the image kicks in. How do I…

How to highlight and select multiple rows?

I would like to be able to perform similar operation to Excel where users can highlight and select multiple rows: [] Here is an example where a user can click on the row and the row gets selected. But I want the green outline similar to Excel to be applied to my Bootstrap table. Ideally, there would be an opt…