Skip to main content

Featured post

How to Insert line break in Text component in React Native

Hi, I was developing an application in react native.I have to handle lots of text data in this small react native application.I have used  Text component in react native many times. While working on this application,i had a requirement to display some text content with line breaks.I will explain it clearly with an example.I want to display a text as shown below  Welcome Please subscribe my channel I wrote react native code as shown below <View> <Text> Welcome Please subscribe my channel </Text> <View> When i run these lines of code,It will display text as shown below Welcome Please subscribe my channel   - instead of displaying in two lines with line break,it displays in a single line.So i have to find a solution to insert line break in Text component in React Native.After lots of research,i found a clean solution as shown below <View> <Text> Welcome{"\n"} Please subscribe my channel </Text> <View> Here ...

How to find Ids from an array of objects in Javascript using MAP method in javascript

When i was working with my personal project, i faced a requirement to get all ids   from an array of objects in javascript. In my array ,all elements are objects.Each element contains an id property.So i need to get  ids of each object elements in the array.The ids should be in the form of array 






In the above code, websitesArray is my array of objects. Each object have an id property.So i need to get all the ids in the form of array in javascript.I will explain , how to get all ids array from array of objects in javascript 







Here using map method in javascript , i could get an array of ids from my websitesArray