avatar

Blogs | Shashank Shekhar

The Typescript Programming Guide

Introduction 🔗By now, TypeScript has emerged as a fully-fledged de facto standard for writing secure, enterprise-grade Node apps. I am building this guide from my experience and the TypeScript handbook to offer a brief introduction for those transitioning from JavaScript but please beware I am no SME on typescript. Readers should have some familiarity with JavaScript and Object-Oriented Programming (OOP). As we all are busy people I have kept the guide as concise as possible while being as clear as I can.

Go Basics - Error as values

Error Handling in Go is bit different than traditional way you must have seen in programming in languages like JavaScript . Instead of traditional “Try/Catch” Go use something called error as values. Go, like most statically-typed languages, mandates that you define the return type of your functions. In order to understand Error handling we must first understand return types . Let’s dive in by creating a basic function, demoFunc, that accepts a string argument and returns it in all lowercase letters.

Go Basics - Map and Structs

While arrays and slices form the core of sequential data structures, maps, interfaces, and structs offer unique capabilities, especially when transitioning from a language like TypeScript. Lets talk about them today. Maps: Go’s Key-Value Store: 🔗A map in Go is a composite type that represents a hash table or a dictionary or object/map in typescript’s case. It associates keys and values where each key maps to a unique value. The key can be of any type for which the equality operation is defined, such as integers, floats, strings, etc.