how to check data type in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check data type in react native, use typeof keyword it will return type of data just we have to use this keyword before variable or data. Let鈥檚 see short example to use typeof to get data type of value. typeof "Hello"; Today, I鈥檓 going to show you How do I check data type in react native, as above mentioned, I鈥檓 going to use the above-mentioned typeof method....

September 8, 2022 路 1 min 路 Infinitbility

how to check null value in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check null value in react native, use if statement it will handle all falsy value or you can compare with null it self. Let鈥檚 see short example to use if statement to handle null value. let value = null; if(value){ console.log("value have data") } else { console.log("value is null or falsy value") } Today, I鈥檓 going to show you How do I check null value in react native, as above mentioned, I鈥檓 going to use the above-mentioned use if statement....

September 8, 2022 路 2 min 路 Infinitbility

how to get last word of string in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get last word of string in react native, use split(" ") method with strArr.length - 1 index value it will return last word from string. You have to only pass " " in split() method. Let鈥檚 see short example to use split(" ") with with strArr.length - 1 index to get last word from string. let strArr = string.split(" "); strArr[strArr.length - 1]; Today, I鈥檓 going to show you How do I get last word of string in react native, as above mentioned, I鈥檓 going to use the above-mentioned split() method....

August 22, 2022 路 2 min 路 Infinitbility

how to get first word of string in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get first word of string in react native, use split(" ") method with 0 index value it will return first word from string. You have to only pass " " in split() method. Let鈥檚 see short example to use split(" ") with with 0 index to get first word from string. string.split(" ")[0]; Today, I鈥檓 going to show you How do I get first word of string in react native, as above mentioned, I鈥檓 going to use the above-mentioned split() method....

August 19, 2022 路 2 min 路 Infinitbility

how to get each character of string of string in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To each character of string in react native, use for...of loop, it will return each character one by one. You have to just use for...of loop on your string string. Let鈥檚 see short example to use for loop on string to get each char. for (let char of string) { console.log(char) } Today, I鈥檓 going to show you How do I get each character of string in react native, as above mentioned, I鈥檓 going to use the for....

August 18, 2022 路 2 min 路 Infinitbility

how to get last two character of string in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get last two character of string in react native, use substring() method to extracts last two character from string. You have to only pass starting and ending postion of string so for last two character pass text.length - 2 as parameter it will return last two character of string. Let鈥檚 see short example to use substring() to get last two character from string....

August 17, 2022 路 1 min 路 Infinitbility

how to get last character of string in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get last character of string in react native, use substring() method to extracts last character from string. You have to only pass starting and ending postion of string so for last character pass text.length - 1 as parameter it will return last character of string. Let鈥檚 see short example to use substring() to get last character from string. text.substring(text.length - 1); Today, I鈥檓 going to show you How do I get last character of string in react native, as above mentioned, I鈥檓 going to use the above-mentioned substring() method....

August 16, 2022 路 2 min 路 Infinitbility

how to get first character of string in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get first character of string in react native, use substring() method to extracts first character from string. You have to only pass starting and ending postion of string so for first character pass 0, 1 as parameter it will return first character of string. Let鈥檚 see short example to use substring() to get first character from string. text.substring(0, 1); Today, I鈥檓 going to show you How do I get first character of string in react native, as above mentioned, I鈥檓 going to use the above-mentioned substring() method....

August 14, 2022 路 2 min 路 Infinitbility

how to get first two character of string in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get first two character of string in react native, use substring() method to extracts first two character from string. You have to only pass starting and ending postion of string so for first two character pass 0, 2 as parameter it will return first two character of string. Let鈥檚 see short example to use substring() to get first two character from string....

August 14, 2022 路 1 min 路 Infinitbility

how to remove item from object in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To remove item from object in react native, use delete keyword it will remove key value pair from object only you have to mantion delete keyword with key. Let鈥檚 see how to use delete keyword to remove item from object. let exampleObject = { id: 1, name: "infinitbility", error: "Feild required" }; console.log("exampleObject", exampleObject); // Output // 'exampleObject' { // id: 1, // name: 'infinitbility', // error: 'Feild required' // } delete exampleObject....

August 10, 2022 路 2 min 路 Infinitbility

how to handle apostrophe in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To handle apostrophe ( single quote, or double quote ) in react native, use the ( \ ) Escape characters or ( ` ) Template literals it will handle both types quotes single and double. Let鈥檚 see how Escape characters and Template literals will solve the issue. let brokenString = 'I'm a broken string'; console.log(brokenString); // Output // unknown: Unexpected token (1:24) brokenString = 'I\'m a broken string'; console....

August 9, 2022 路 2 min 路 Infinitbility

how to check nan in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check or handle NaN in react native, use the isNaN() method it will return if the value is not a number, if the value is a number it will return false. Let鈥檚 understand when the isNaN method returns false or when true. Number.isNaN(NaN); // true Number.isNaN(Number.NaN); // true Number.isNaN(0 / 0); // true // e.g. these would have been true with global isNaN() Number....

August 7, 2022 路 2 min 路 Infinitbility

how to check undefined in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check or handle undefined in react native, use the if statement it will go inside in if statement if the value is not undefined. Basically, If the statement will handle all your false values like 0, false, "", undefined, etc. let value = undefined; if(value){ console.log("value have some data") } else { console.log("value is undefined") } Today, I鈥檓 going to show you How do I check or handle undefined in react native, as above mentioned, I鈥檓 going to use the if statement to check value is undefined or has some data....

August 6, 2022 路 2 min 路 Infinitbility

how to empty an array in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To empty an array in react native, set [] empty array in a state it will remove the existing array of elements and store a new empty array in a state. setArr([]); Today, I鈥檓 going to show you How do I empty an array in react native, as above mentioned, I鈥檓 going to use the above-mentioned set [] empty array syntax method to empty an array....

August 2, 2022 路 1 min 路 Infinitbility

how to pass parameter to a promise function in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To pass parameters to a promise function in react native, create a parameter function and use promise in a function like the below example. var getNameById = function (id) { return new Promise(function (resolve, reject) { // ... }); }; getNameById(3).then(function (res) { console.log(res); }); // output: "Stuff worked" Today, I鈥檓 going to show you How do I pass parameters to a promise function in react native, as above mentioned, I鈥檓 going to use the above-mentioned syntax to create and use a promise function with a parameter....

August 1, 2022 路 2 min 路 Infinitbility

how to add two numbers in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To add two numbers in react native, use the + addition operator it will add if your value datatype is a number else if your value datatype is string first convert it using parseInt() and then perform addition operation. In the following example, we will take the sample numbers, and strings and perform add operation using the + addition operator. Adding Two numbers example let num1 = 30; let num2 = 34; num1 + num2; // 64 Adding Two string numbers example let num1 = "30"; let num2 = "34"; parseInt(num1) + parseInt(num2); // 64 Today, I鈥檓 going to show you How do i add two numbers in react native, as mentioned above here, I鈥檓 going to use the + addition operator....

July 15, 2022 路 2 min 路 Infinitbility

how to center text in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To center text in react native, just use the textAlign css property it will center text horizontaly and for vertical center flex: 1, justifyContent: "center", on upper element. Today, I鈥檓 going to show you How do I center text in react native, as above mentioned here, I鈥檓 going to use the textAlign and justifyContent css property to make text center. Let鈥檚 start today鈥檚 tutorial how do you center text in react native?...

July 9, 2022 路 2 min 路 Infinitbility

how to remove double quotes from string in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To remove double quotes from a string in react native, just use the replaceAll('"', '') method it will replace double quotes with an empty string and return a new string without double quotes. Like the following example, let鈥檚 take the below sample string example here we will remove all double quotes available in the string. const str = 'Hi" Friend"s, Welcome "to" infinitbility'; // 馃憞锔 'Hi Friends, Welcome to infinitbility' str....

July 6, 2022 路 2 min 路 Infinitbility

how to check empty object in react native?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To check the empty object in react native, just use the Object.keys() method it will create an array of object keys after then you can check the length and if it鈥檚 equal to 0 means the object is empty. Like the following example, let鈥檚 take the below array of objects example here we will find an index of id 3 and delete it from the array....

June 28, 2022 路 2 min 路 Infinitbility

how to remove react native cli globally?

Hi Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To remove react native cli globally, just use the npm uninstall -g react-native-cli command in your cmd or terminal it will uninstall react native cli from your computer. As per react native documents, they are telling you shuld remove react native cli and just use your cammand with npx it will work. If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues....

June 27, 2022 路 1 min 路 Infinitbility