My app has a test sheet, if a user passes the test he is shown a passing screen and then the state is saved using asyncstorage. But the problem here is, let’s say i have user A and user B and user A is currently logged in, he passed the test and the app shows him passing screen and the
calculate compound profit in javascript
I have to calculate compound profit. for example, I have $100, increasing 10% monthly, and I have to calculate the total profit for 12 months. And I need a profit of every month in an array. I have tried this Answer There seems to be a bit of missing info here, but if “profit” means the amount gre…
Remove redundant legends on the chart using generateLabels with ChartJS v3
I have a chart as follows, I only need one pair of legends (data 1 and data 2) to show on the chart. In ChartJS v2, I can use generateLabels like this but it doesn’t seem to work the same way in v3 that I’m using. Is there an easy way to achieve this in v3 using generateLabels or do
POST net::ERR_NAME_NOT_RESOLVED
I’m trying to create a simple web application form. It requires the user to input their information, and click submit which ideally would hit an api and store the information somewhere like dynamodb. I have this code which is returning a response error POST net::ERR_NAME_NOT_RESOLVED For the life of me,…
Responsive nav bar not sticking on some screens
I am having a problem with the taskbar on my webpage. It is “sticky” on scroll down on a laptop screen, even when I resize the window to a size where the nav menu goes into a toggle. However when I use the inspector to view it on IPhone or any screen type using the chrome inspector the “stic…
attributeChangedCallback() always called twice ending up with multiple event listeners
Playing around with custom elements, I’m trying to get a click event fired depending on custom element attribute’s value. But using the attributeChangedCallback() method (along with the connectedCallback() method) I’m ending up with multiple event listeners. Why is the attributeChangedCallba…
Shuffle multiple arrays in the same way but with Lodash
I’ve got two arrays I need to shuffle both arrays so that they come out the same way, ex: There’s a few posts on stackoverflow that shuffle arrays in the way I described –this one is pretty great– but none of them demonstrate how to shuffle two arrays using Lodash. The JavaScript metho…
Hide or show input on dropdown selection
I am trying to create a sign-up page for my app. All the code works, but when I try to hide input box based on dropdown select, it doesn’t work. I tried this: But it didn’t work. And this is my code for the signup page: Answer It does work, you only need to place the script underneath the form
Using an empty string in path fails
In my node API i have some function that updates the email address Array of either a contact or a farm, its the same concept but the difference is where the array is located in farms is in Records.emails and in Contacts its in emails. So in my case I decide based on _type what the path is. In case
my three.js scene is not rendering. not sure why
my main.js file contains :- and my index.html :- All that appears on my screen is :- [what displays on my browser][1] [1]: https://i.stack.imgur.com/PQmJu.png I checked and my main.js file is definitely executing, but nothing is rendering on the screen Answer You have a few issues. This would select elements …