Function Types

Developed with
QA

The course is part of this learning path

Typescript: Zero to Hero
course-steps
8
certification
2
play-arrow
Function Types
Overview
DifficultyBeginner
Duration9m
Students37
Ratings
5/5
starstarstarstarstar

Description

This module introduces you to Interfaces in TypeScript.

Learning Objectives

The objectives of this module are to provide you with an understanding of:

  • How to use Function Types
  • How to use Optionals
  • How to use Excess Property Checks
  • How to use Indexable Types
  • How Interfaces work with Classes
  • How to create Extendable Interfaces

Intended Audience

This learning path is aimed at all who wish to learn how to use TypeScript

Prerequisites

It is essential you understand the face of contemporary web development to attend this course. You should have a good working knowledge of Javascript. Please note: Before attending this class delegates must have a Microsoft account (signing up one is free).

Feedback

We welcome all feedback and suggestions - please contact us at qa.elearningadmin@qa.com to let us know what you think.

Transcript

If we look at function types with interfaces, the code shown has an interface called Log. That is defined and has a function that takes a string called error, and provides no return value. logError is a function of type Log. Meaning that it's signed the contract with the Log interface. logError is a function that takes a string called x, and has no return value. It meets the contract, so there's no errors shown. Interfaces can describe the wide range of shapes that JavaScript objects can take. Including functions and specifying the shape of a set of arguments of a function. It's one of the most common uses for interfaces in TypeScript. Note that the parameter name in the implementation need not match the name in the interface.

Lectures

About the Author

Students1804
Labs8
Courses29
Learning paths5

An outstanding trainer in software development with more than 15 years experience as a Corporate and Apprentice Trainer, ICT Teacher and Head of Department, with a passion for technology and its uses. Continuing to develop existing and new skills and courses, primarily in web design using PHP, JavaScript, HTML, CSS and SQL but also OOP (Java), programming foundations (Using Python), DevOps (Git, CI/CD, etc) and Agile/Scrum. Practically minded, a quick learner and a problem solver with an attention to detail to ensure high quality outcomes.

Covered Topics