Skip to content

Category: Questions

Remove last part of String in Javascripts

I’m struggling with a code in JS in order to extract the last part of a String. Examples of the input strings could be: or and I need the first part until the second . like this or Answer You can use combination of split, slice & join to do this Working split(“.”) returns an array You on…

SwipeJS not functioning properly

So I tried to use Swipe.Js today. When I’m importing I used this code line. So I looked at the node_modules folder and then I found where is the Swiper and SwiperSlide functions are. So I imported that file by using this line. import { Swiper, SwiperSlide } from ‘swiper/react/swiper-react.js&#8217…

Javascrip cannot access object properties from map method

So i have been having some problems with javascript’s map method. For some reason i cannot access objects properties from map function. Even though i am using the function on an array. When i print out the object the output is; Output of console.log(marker) this is the output of console.log(hospitalMark…

How to find maxium value from nested array Object in Javascript?

how to find biggest value for particular array objects from nested array. My Javascript Array: I want to find the maximum value of the nested chartData array. I want a method to calculate the maximum value and for the above data the output should be 60. Can anyone help ? Answer you can use this way: