onyeePeace

HomeBadges
Blog Author Picture

Onyee Peace

I am a JavaScript Front End Developer focused on ReactJS and animations.

What 2020 was like...

Dec 31, 20204 min read

Life is in phases, men are in sizes. Putting in constant effort will result in growth and development. It may seem like very little progress, but something is happening. Efforts are building up and will result into something great. It can be diffic...

Unions & Type Aliases in TypeScript

Dec 28, 20202 min read

Description Unions Unions are used to combine more than one data type to be used on a variable. This is how it is done; // This can be used to declare multiple data types in a variable let combined: (string | number)[] = []; //When using unions on ar...

Explicit Types in TypeScript

Dec 27, 20202 min read

Description Data types can be explicitly declared in TypeScript. Although TypeScript automatically infers a data type on a variable declared. Learning material used is Net Ninja's TypeScript course on YouTube. Here is how it is done; Example 1: Stri...

Function Types (signatures) in TypeScript

Dec 26, 20202 min read

Description This is used to describe the general structure of a function, the argument it takes in and the type of data it returns. // example 1 let greet: (a: string, b: string) => void; greet = (name: string, greeting: string) => { console.log(...

Functions in TypeScript

Dec 25, 20202 min read

Description Functions can be declared this way using TypeScript. let greet: Function; //greet has been set to a function. Note that it has to be Function with a capital F. greet = () => { console.log('helllo') }; greet(); //specifying data type...

Objects in TypeScript

Dec 24, 20201 min read

Description Objects are declared this way in TypeScript let person = { name: 'marko', gender: 'male', age: 30 }; //The data type of the person variable is object. Quick Note If you declare a variable to be a particular data type, you can't ch...

© 2021 onyeePeace

PrivacyTerms
Proudly part of