Code Monkey home page Code Monkey logo

bicara-typescript's Introduction

Bicara TypeScript

This repo contain resource of Bicara Typescript. Youtube Series for Learn Typescript

Branches :

master : starter code

finish : finish code

1. JavaScript vs TypeScript Types

Javascript Typescript
1 undefined undefined
2 boolean boolean
3 number number
4 string string
5 bigint number
6 symbol symbol
7 null null
8 object object
9 function function
10 - any
11 - union
12 - intersection
13 - enum
14 - void
15 - advance type

Notes :

  • 1-6 are Primitive Data Types
  • All primitives are immutable. A primitive is not an object and has no methods of its own.
  • Null is special primitive
  • All types in TypeScript are subtypes of a single top type called the Any type.

Exercises :

  • Evaluate all JavaScript Types
  • undefined vs null vs not defined
  • Cons & Pros Dynamic Type

2. Typescript Types

How to declare typescript type :

  • Type inference ( implicit ) let ti = "hello"
  • Type annotations ( explicit ) let ta:string = "hello ts"

Exercises :

  • Convert all JavaScript Types to TypeScript
  • Function Type
  • Union Type |
  • Type Aliases
  • Setup Environtment ( eslint, prettier )

3. Array & Tuples

Tuples is an array with fixed size and known data types.

There are few ways to declare an array:

  1. Using Type Inference let list = [1, 2, 3, 4];
  2. Using square brackets. elementType[] let fruits: string[] = ['Apple', 'Orange', 'Banana'];
  3. Using a generic array type. Array<elementType> let fruits: Array<string> = ['Apple', 'Orange', 'Banana'];

Exercises :

  • Array of Number
  • Array of String
  • Array with Union
  • Tuple
  • Array of Object
  • Array multidimensional
  • Destructuring

4. Object

Object is a type that represents the non-primitive type, i.e. anything that is not number, string, boolean, bigint, symbol, null, or undefined

Exercises :

  • Object Literal
  • Nested Object
  • Nested, Object of Array
  • Nested, Object of Object ( Dynamic Properties)
  • Destructuring
  • Utility Types ( ReadOnly, Record )

5. Functions

Functions are the building blocks of readable, maintainable, and reusable code. A function is a set of statements to perform a specific task. Functions organize the program into logical blocks of code.

Exercises :

  • function basic : declaration,expression, arrow
  • optional & default parameters
  • rest parameter
  • conditional type with union, generic, overloads

6. Classes

  • class basic : constructor, properties, method
  • access modifiers (private, public, private)
  • inheritance / sub-class
  • static member
  • abstract classes
access modifier class sub-class instance
public
protected
private

7. Interface vs Type

Feature Interface Type
aliases
object
merge
Intersection & Union
implementes
extend

8. Advanced Type

  • Partial Partial<T>
  • Required Required<T>
  • Readonly Readonly<T>
  • Pick Pick<T, K>
  • Omit Omit<T, K>
  • Record Record<K,T>
  • Extract Extract<T, U>
  • Exclude Exclude<T,U>

bicara-typescript's People

Contributors

adlinmh avatar sastranababan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bicara-typescript's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.