Posts for Deven

Deven is an Entrepreneur, and Full-stack developer, Constantly learning and experiencing new things. He currently runs CodeSource.io and Dunebook.com
Deven
Deven wrote

How to concatenate strings in golang?

In this article, you are going to learn about string concatenation in Golang. String concatenation means the way of adding two or more strings into a new single string. Like other programming languages, Golang has the functionality of string concatenation. In Go language, the string is a read-only slice of bytes that is also known […]

December 9, 2021 in Code examples & GoLang
Deven
Deven wrote

How to read file line by line in Golang

In this article, you are going to learn about how to read file line by line in Golang. Golang is an open-source programming language which is developed by Google. By using Golang you can do so many things, reading files line by line is one of them. To read a file in Golang, we will […]

December 9, 2021 in Code examples & GoLang
Deven
Deven wrote

How to check if file exists in Golang

In this article, you will learn about how to check if a file exists or not in Golang. In Golang, you can check for the existence of a file by using Stat() function. It is provided by os package in Golang. Basically, the Stat() function returns a FileInfo with the named file and it will […]

December 9, 2021 in Code examples & GoLang
Deven
Deven wrote

How to convert float to int in Golang

In this article, you are going to learn about how to convert a float64 number into an integer in Golang. In Golang, datatypes are very strict which means if you declare a variable type as float64 you can not write any other value except float number. If you try to write an integer number into […]

December 9, 2021 in Code examples & GoLang
Deven
Deven wrote

How to setup GoLang Authentication with JWT token

Golang Authentication is the process of recognizing the user’s identity. That means based on users’ credentials, one will be able to perform certain types of action. For example, you have a blog application where anonymous users can visit and see the blogs, but the moment the user wants to do activities like, comment, or create […]

December 3, 2021 in GoLang & Tutorials
Deven
Deven wrote

How to check typeOf a variable in Golang

In this article, you are going to learn about how to check typeof variable in Golang. Like other programming languages, Golang has different types of variables. such as integer, string, and so on. To check a variable type, GoLang provides a reflection package. With the help of this package, you can easily detect a variable […]

December 3, 2021 in Code examples
Deven
Deven wrote

How to test async code in Mocha

In this article, you will learn how to test async code by using Mocha. Mocha is a JavaScript test framework that runs on Nodejs as well as in Browser. It is an open-source testing framework for JavaScript. In mocha, you can test your asynchronous JavaScript code. Let’s build an async function for the test with […]

December 2, 2021 in Code examples
Deven
Deven wrote

How to trigger enter key in JavaScript

In this article, you are going to learn about how to trigger an enter key in JavaScript. Basically, we submit a form input by clicking on the button. But sometimes you need to implement the functionality where form input will be submitted by pressing an enter key from the keyboard. It is easy to implement […]

December 2, 2021 in Code examples
Deven
Deven wrote

How to do input focused in JavaScript

In this article, you will learn about how to focus an input field by using JavaScript. JavaScript is a text-based programming language that is used both on the client-side and server-side. You can bring activity to your web page and make web pages interactive. Input focused is one kind of interactivity that you can use […]

December 2, 2021 in Code examples
Deven
Deven wrote

in vs hasOwnProperty in JavaScript

In this article, you are going to learn about the difference between hasOwnProperty and in. In JavaScript, an object is a self-sustained entity, with properties and type. Compare it with a person, for example. A person is an object, with properties. A person has eyes, legs, weight, ears, hands, etc. In the same way, JavaScript […]

December 2, 2021 in Code examples
Deven
Deven wrote

How to redirect with express

In this article, you will learn about how to redirect with express. Express is a popular backend web application framework for nodejs. It is mainly designed for building web applications and APIs. Express lets you write server-side logic for web and mobile applications. You can easily redirect a URL in express to do so you […]

December 1, 2021 in Code examples
Deven
Deven wrote

​​How to make a POST JSON request with Axios

In this article, you will learn about Post JSON request with Axios. In JavaScript, Axios is a library that is used to make HTTP requests from Node and is also used in front-end applications. It is a promise-based API. You can Post JSON requests with Axios by calling axios.post() method. This method simply expects two […]

December 1, 2021 in Code examples
Deven
Deven wrote

How to get selected option value in jQuery

In this article, you are going to learn about how to get selected options value in jQuery. jQuery is a speedy, lightweight, and easy-to-learn JavaScript library. With this library, you can manipulate the HTML DOM tree as well as event handling and bring interactivity to your web page. jQuery provides lots of library methods, :selected […]

November 1, 2021 in Code examples
Deven
Deven wrote

How to handle Axios error

In this article you will learn about how to handle axios error. In JavaScript, Axios is a promise-based API, which is basically a JavaScript library. It is mainly used to make HTTP requests from Node and is also used in front-end applications. As Axios requests is a promise-based API, it lets you perform promise chaining […]

October 29, 2021 in Code examples