When I place svg image next to text, with vertical-align: middle;, then it aligns pretty nicely. However, if I use svg in the ::after pseudo-element, then the results are not as expected. Furthermore, when I click on text to remove its content, then remaining svg element still keeps its unaligned position: He…
Connect mangoDB Atlas with nodejs
I can’t connect to MongoDB database, yet I tried everything ! I have successfully replaced the password. Here is the Database MangoDB Answer You will need another function to complete the operation. the function is usually called run then you need to write all the operations of your server in the scope …
Two routes use params but only one is working
I’m trying to make a website that show you all the restaurants in the country with all th different cities. I add a route for restaurants that use params to redirect you to the restaurant page. And another route that also use params to take you to the city details page The problem is that only the resta…
Select only the clicked button JQuery
I have this ajax function, which should change the style of the clicked button, but for some reason it does not work. I’m not getting any errors in the console and the ajax call is successful Any idea what’s wrong here? Html: Answer Your issue is with using this incorrectly. The way you are using …
Get the nearest object key from object containing multiple objects with numeric keys
I have an object containing an undefined number of child objects which are associated by numeric values as the object keys. What I need is a way to pass in a numeric number (currency) and get the child object that is the closest to the number I pass into the function. Example Object structure The keys of the …
How to export and use a function using Express?
I have two file alarm.js and notifications.js. In alarm.js I need to call a method called sendPush from notifications.js. What I’ve tried : Exporting the function from notifications.js: Importing it in alarm.js and use it : The problem: I keep getting the error saying helperNotif.sendPush is not a funct…
Trying to return a filter() value from an array of objects based on conditionals
I’m trying to return only a part of my object as an array based on conditionals but I’m kinda stumped. I have an array of objects and I want to return an array of names for each key : value they fit in. I do get only the unique pairings but I’m returning the food key:value as well and all
The best way to query by location in firestore
I am using Firebase 8.10.0 with Vue js 2.6.14 I am trying to query in Firestore about the documents that are less than 3 km away from my location And discovered that I could not do this query in firestore, I was frankly disappointed Then after watching a video by Frank van Puffelen on YouTube “Querying …
Javascript make object string keys enumerable
I have a class set up with string keys, like this: The goal is to dynamically loop over the functions in an instance like this: However, everything I have tried has only resulted in the keys id and data. I can manually get the function and run it just fine: But it does not show up in any dynamic enumeration
How to use react-phone-input-2 with Typescript
I am new to Typescript but I’m forcing myself to program in it because they say it is “best” practice and beneficial in the long run… so now I’m trying to use react-phone-input-2 https://www.npmjs.com/package/react-phone-input-2 The example on the page above is for just standard …