In this article, we will share a very simple JavaScript code snippet through which you can easily integrate your webcam into an HTML5 web page. Now, a day most of the website provides real-time webcam integration for profile picture upload or any account verification step. First, create an HTML DOM structure using the following code …
Category : Typescript
10 posts
Typescript History Let see important landmarks from the history of Typescript: After two years of internal development at Microsoft. TypeScript 0.9, released in 2013 Additional support for generics TypeScript 1.0 was released at Build 2014 In July 2014, a new TypeScript compiler came which is five times faster than it’s the previous version. In July …
Namespaces in Typescript Namespace is basically has collection of classes, interfaces, variables, functions together in one file. Namespace Syntax: namespace name{ export class { } export interface { } export const constname; } The code related in available under one namespace. Namespace working example: testnamespace.ts namespace StudentSetup { export interface StudDetails { name: string; age: …
What are the Modules in Typescript? The files created in typescript have global access, which means that variables declared in one file are easily accessed in another file. This global nature can cause code conflicts and can cause issues with execution at run-time. You have export and import module functionality which can be used to …
What is an Enum? An enum is an object which has a collection of related values stored together. Javascript does not support enums. Most of the programming language like java, c, c++ supports enum and it also available with typescript too. Enums are defined using keyword enum. How to declare an Enum? Syntax: enum NameofEnum …
What is the use of Arrow Function? Let’s take a look at the example to understand the use case of Arrow function: Example : var ScoreCard = function () { this.score = 0; this.getScore = function () { setTimeout(function () { console.log(this.score); // gives undefined. }, 1000); } } var a = new ScoreCard(); a.getScore(); …
Access Modifiers in Typescript Typescript supports public, private, and protected access modifiers to your methods and properties. By default, if access modifiers are not given the method or property is considered as public, and they will be easily accessible from the object of the class. In case of private access modifiers, they are not available …
What is an Array? An array is a data type in typescript wherein you can store multiple values. Let’s learn how to declare and assign values for an array. Since typescript is a strongly typed language, you have to tell what will be the data type of the values in an array. Otherwise, it will …
Types in Typescript Typescript is a strongly typed language, whereas javascript is not. A variable which has a value defined as a string can be changed to a number without any issues in Javascript. The same is not tolerated in typescript. In typescript, the type to a variable is defined at the start only and …
What is Typescript ? Typescript is a superset of JavaScript. It is an open source language developed by Microsoft which statically compiles the code to JavaScript that can easily run in a browser or in Nodejs. All the latest features released for ECMAScript are supported in typescript and in addition to it Typescript has its …