How to get current date in react native?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get the current date in react native has the Date() object it will return every time the current date and time when we use it. you have just call it like new Date(). we have to just write new Date() and it returns the date object where we get a year, month, date, hours, minutes, and seconds. let today = new Date(); console....

February 14, 2022聽路聽2 min聽路聽Infinitbility

How to get current month in react native?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get the current month in react native has the new Date().getMonth() method which will return every time the current month index in number datatype. we have to just call new Date().getMonth() and it will check the current date and return month index based on the date. let monthIndex = new Date().getMonth(); console.log(monthIndex); // 1 for Feb, 0 for jan So whenever we have to so month number we have to add 1 in got value from new Date()....

February 14, 2022聽路聽2 min聽路聽Infinitbility

How to get current year in react native?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get the current year in react native has the new Date().getFullYear() method which will return every time the current year in number datatype. we have to just call new Date().getFullYear() and it will check the current date and return the current year based on the date. let year = new Date().getFullYear(); console.log(year); // 2022 Now, we know how to get the current year in react native and the way to hold in a variable....

February 14, 2022聽路聽1 min聽路聽Infinitbility

How to get array from json object in react native?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Every time, we got an array in an object and we have to use arrays from objects. Today, we will see how we will use an array from an object in React native. In this tutorial, we will take the example of an object in an array of objects and we will iterate every row of arrays. Let鈥檚 start Today鈥檚 tutorial How to get an array from JSON object in react native?...

February 13, 2022聽路聽2 min聽路聽Infinitbility

How to get array index value in react native?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get index value of element in react native have indexOf() and findIndex() method but both have different poupose of use. Today, we will learn how to get index array elements in react native and we will see examples with an array of string and an array of objects. Let鈥檚 first understand when use indexOf() or findIndex() method. The indexOf() method is used for an array of primitive datatypes like string, number, etc or you can also say single dimension array....

February 11, 2022聽路聽2 min聽路聽Infinitbility

How to get current time in react native?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get the current datetime in react native has the Date() object it will return every time the current date and time when we use it. we have to just write new Date() and it returns the date object where we get a year, month, date, hours, minutes, and seconds. let today = new Date(); console.log(today); // 2022-02-06T08:05:49.292Z Now, we know we have the current date time but we can鈥檛 show the same to also users....

February 11, 2022聽路聽2 min聽路聽Infinitbility

How to get object value using the dynamic key in javascript?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Let鈥檚 assume we have a user object that store all user details key value-based and I have another object that store which property value we need from the object user. Here, we have to assume also seconds object data will changes at any time i.e we need dynamic key logic in javascript. So, we have to get user keys in seconds which we will use to get value from the first user object....

February 10, 2022聽路聽1 min聽路聽Infinitbility

How to get array length in react native?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To know the length of an array in react native has the same syntax as javascript. we have to just use arrayVeriable.length syntax and it will return array element count. Today, we will learn how to create an array and how to check array length in react native. Let鈥檚 start with the creation Now, we are going to create an array of objects then we have to store it to state and then we will print their length on screen....

February 9, 2022聽路聽2 min聽路聽Infinitbility

How to get current UTC date in typescript?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get the current date in typescript has the Date() object it will return every time the current date and time when we use it. we have to just write new Date() and it returns the date object where we get a year, month, date, hours, minutes, and seconds. let today: object = new Date(); console.log(today); // 2022-02-06T08:05:49.292Z Now, we know we have the current date but when we want to convert the date in UTC or want to get the UTC date-time we have also followed some other steps....

February 8, 2022聽路聽1 min聽路聽Infinitbility

How to get current month in typescript?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get the current month in typescript has the new Date().getMonth() method which will return every time the current month index in number datatype. we have to just call new Date().getMonth() and it will check the current date and return month index based on the date. let monthIndex: number = new Date().getMonth(); console.log(monthIndex); // 1 for Feb, 0 for jan So whenever we have to so month number we have to add 1 in got value from new Date()....

February 7, 2022聽路聽1 min聽路聽Infinitbility

How to get current year in typescript?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get the current year in typescript has the new Date().getFullYear() method which will return every time the current year in number datatype. we have to just call new Date().getFullYear() and it will check the current date and return the current year based on the date. let year: number = new Date().getFullYear(); console.log(year); // 2022 Now, we know how to get the current year in typescript and the way to hold in a variable....

February 7, 2022聽路聽1 min聽路聽Infinitbility

How to get current time in typescript?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get the current datetime in typescript has the Date() object it will return every time the current date and time when we use it. we have to just write new Date() and it returns the date object where we get a year, month, date, hours, minutes, and seconds. let today: object = new Date(); console.log(today); // 2022-02-06T08:05:49.292Z Now, we know we have the current date time but we can鈥檛 show the same to also users....

February 6, 2022聽路聽1 min聽路聽Infinitbility

How to get current date in typescript?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get the current date in typescript has the Date() object it will return every time the current date and time when we use it. we have to just write new Date() and it returns the date object where we get a year, month, date, hours, minutes, and seconds. let today: object = new Date(); console.log(today); // 2022-02-06T08:05:49.292Z Now, we know we have the current date but we can鈥檛 show the same to also users....

February 5, 2022聽路聽1 min聽路聽Infinitbility

How to get array from json object in typescript?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Every time, we got an array in an object and we have to use arrays from objects. Today, we will see how we will use an array from an object in TypeScript. In this tutorial, we will take the example of an object in an array of objects and we will iterate every row of arrays. Let鈥檚 start Today鈥檚 tutorial How to get an array from JSON object in typescript?...

February 4, 2022聽路聽2 min聽路聽Infinitbility

How to get array index value in typescript?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get index value of element typescript have indexOf() and findIndex() method but both have different poupose of use. Today, we will learn how to get index array elements in typescript and we will see examples with an array of string and an array of objects. Let鈥檚 first understand when use indexOf() or findIndex() method. The indexOf() method is used for an array of primitive datatypes like string, number, etc or you can also say single dimension array....

February 3, 2022聽路聽2 min聽路聽Infinitbility

How to get array length in typescript?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To get the array length in typescript, just use Array.length it will count and return the numbers of the element. You have just like ArrayVariable.length; array.length In TypeScript, creating an array has some different syntax because typescript supports static typing. i.e when we create an array we have first what we will store in the array-like string, number, object, etc. Today, we will learn how to create an array and how to check array length in typescript....

February 2, 2022聽路聽1 min聽路聽Infinitbility

How to add key and value from json array object in javascript

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 To transfer data from one file to another, or project to another we used JSON i.e we need many times to add data in JSON objects statically, and dynamically. Today, we will see how to add elements to an object and also how many ways to do that with example. let鈥檚 start with when we create a new object. Create an object with key-value pair When we create a new object we mainly use {} curly brace to create and when we want to create an object with value....

February 1, 2022聽路聽2 min聽路聽Infinitbility

How to convert boolean to number in typescript?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, we will know the easiest way to convert boolean to number in typescript. TypeScript has + unary operator which helps you to convert boolean to the number when we add a unary operator with true it will return 1, and with false it will return 0. Take an example let trueBool: boolean = true; let falseBool: boolean = false; console.log(+trueBool) // 1 console....

January 31, 2022聽路聽1 min聽路聽Infinitbility

How to convert number to boolean in typescript?

Hello Friends 馃憢, Welcome To Infinitbility! 鉂わ笍 Today, we will know easiest way to convert number to boolean in typescript. TypeScript have !! double exclamation which help you to convert number to boolean like when we add double exclamation with 1 it will return true, with 0 it will return false. Take an example let statusZero: number = 0; let statusOne: number = 1; console.log(!!statusZero) // false console.log(!!statusOne) // true Output TypeScript, convert number to boolean example The !...

January 31, 2022聽路聽1 min聽路聽Infinitbility

How to remove keys with null values in javascript?

Hello Friends 馃憢, Welcome to Infinitbility. When we got objects from the server or API sometime鈥檚 we get keys with null or undefined values and it will throw an error when we use them blindly. I.e we will learn how to delete keys that have null, or undefined values. To remove javascript falsy values we used javascript Object.keys(), forEach() or for loop, and delete operator. javascript Object.keys() method to get an array of the object鈥檚 keys....

January 30, 2022聽路聽2 min聽路聽Infinitbility