Skip to content

Tag: javascript

shorten if conditions in js

I want to shorten the conditions of a javascript if but I don’t know how I can achieve it code: I have the conditions defined in this way: I appreciate any help! 🙂 Answer You can remove all unnecessary parenthesis in your if condition: Other than that, there’s not really a clean, readable way to s…

How to extract all arrays in json object

I have a json object which has a collection of countries. Each country can have multiple regions which are represented in an array. I want to get the regions only and put all regions into one list.However when I map the data it doesn’t put all the regions in a list. What am I missing here? Here is the c…

Passing Response data to chartjs

I want to pass this json response data to a chartjs horizontal bar using angular this is the response : I tried this using x axes and z axes of the horizontal bar of chart js using this code But it seems it doesont work because i alwyas have duplication with different colors like this: i want to regroupe each

How to access data souce Angular Material Table

I hope everyone is doing great. Im trying to render data to the table for a material table but I cant solve why it isnt working. When I want to assign the data to the datasource for the table to render it dosnt get the information. Would apprecaite if someone could look for a secound and see if something. Typ…

feathers js get custom attribute value

I’m first time using feathers and Sequelize. I want ask something for the example I have data user my expected return but I got all data user b Answer You can use the after hook to delete the properties that you don’t want to get. Or you can use the feathers.js common querying to deselect the spec…