I want to create a mostly static site (and have been thinking about using Next.js), however it should include the possibility to get a price estimate based on customer specifications. This computation …
Category: Questions
ERROR TypeError: Cannot read property ‘salt’ of null
I am having troubles trying to encrypt and decrypt the values of local and session storage. Thank you for your time and your help. I need to encrypt the values of local and session storage, and decrypt when it’s necessary. I do not know where it’s the failure. Which one it’s the easiest way …
How do I map an through an array of objects and display each object individually? I want each pizza order to show
I am not sure how to iterate through each order and show them as individual orders. The api response looks like this… 0: Crust: “THIN” Flavor: “CHEESE” Order_ID: 2 Size: “S&…
How to import a js Module as any. (Without any declaration file (d.ts))
So I want to import a js module in my ts app. Is there a way to do this without making a d.ts file or if not how to declare it as any in the d.ts file? I am currently just ignoring this error with //@ts-ignore. Thanks! Answer There are two cases here: You are using ESM modules, and only
How to pass a key value into the onchange handler for a select dropdown
I’m mapping an array[key,val] to dynamically create dropdowns. I want to pass the key from the select onChange handler so I can store the selected value in the correct index in the array. How do I pass the key. Answer You could do something like this: This way can be used for all types of form fields, b…
How to turn data from a txt file into an array of objects in Node
I’m new to Node, and I have a text file that has data like this I would like to create an array of objects like this How can I do this? This was my attempt: But this create an array for each object and I get all the data showing under date like this: Answer You can try readline internal
Arabic Text issue with PDFKit plugin
To generate dynamic PDF files, I’m using PDFKit. The generation works fine, but I’m having trouble displaying arabic characters, even after installing an arabic font. Also, Arabic text is generated correctly, but I believe the word order is incorrect. As an example, I’m currently using pdfki…
Update array based on id Javascript
I want to update he array based on id with some conditions. Conditions were = console.log(myupdate(data1, update1)) should update the data1 as bellow based on id here the type is changed to bar console.log(myupdate(data1, update2)) here as no item with id 125 exist so it adds a new one console.log(myupdate(da…
How do I make @click of a div that is receiving looped data of an API the div popups a window showing the rest of the keys in each object in the API
The div with {{user.name}} when clicked I want it to show the rest of the details in the Api like user.email, user.occupation, in a new window, Api data is coming from store. am still new to vuex. Answer Add click event listener to div with .native modifier if you are using Vue 2 or without if you are using V…
Common scenario with react hooks: how to change hook dependency without causing infinite render
I’m writing a React application and I have a common scenario that I would like to know how to solve from design point of view rather than with workarounds. Often I’m in a situation where I have to …