Author: Arpit Mandliya
- 11 June
Break out of function in Python
In this post, we will see how to break out of function in Python. Break out of function in Python A function is a block of reusable code that can be called whenever required in a program. In Python, we can create functions using the def keyword. A function can return some value. This value […]
- 11 June
Check if Object Is Iterable in Python
In this post, we will see how to check if object is iterable in Python. What are iterables in Python? An iterable is an object that contains a sequence of elements that can be iterated over using a simple for loop. Lists, tuples, and strings are examples of such objects. Objects of such classes have […]
- 11 June
Save Numpy Array as Image in Python
In this post, we will see how to save numpy array as image in Python. Save numpy array as image in Python Python provides a wide range of libraries that can be utilized to read and process images efficiently. Images are also processed efficiently while carrying out Computer Vision tasks. But how does Python store […]
- 30 May
Count Down in a for Loop in Python
1. Introduction In Python, looping is a fundamental concept used in various applications, ranging from simple iteration to complex data processing. A common scenario is to perform a countdown, where we iterate in reverse order, typically starting from a higher number down to a lower number, such as counting down from 10 to 1. For […]
- 25 May
Remove Double Quotes from String in JavaScript
In this post, we will see how to remove double quotes from String in JavaScript. Ways to Remove Double Quotes from String in JavaScript There are multiple ways to do it. Let’s go through them. Using replace() To remove double quotes from String in JavaScript: Use replace() method with regular expression /"/g as first parameter […]
- 25 May
Convert Seconds to Hours Minutes Seconds in Javascript
In this post, we will see how to convert seconds to Hours Minutes Seconds in JavaScript. There are multiple ways to do it. Let’s go through them. Using javascript without any external library To convert seconds to Hours Minutes Seconds in javascript: Create new date object with its constructor. Pass seconds to setSeconds() method on […]
- 25 May
Remove First Character from String in JavaScript
In this post, we will see how to remove first character from string in JavaScript. Since Strings are immutable in JavaScript, you can’t do it in-place. All the methods will return new String and you can either assign it to same variable or to new one. Ways to Remove First Character from string in JavaScript […]
- 25 May
Get Variable Name as String in JavaScript
1. Overview Retrieving a variable’s name as a string in JavaScript can be a handy technique in various programming scenarios, from debugging to dynamic property handling. We’ll explore several methods to convert variable names into strings, covering different use cases. Let’s consider a situation where we have a JavaScript variable, say myVar, and our objective […]
- 25 May
Type ‘String’ cannot be used as an index type in Typescript
In this post, we will see how to fix error Type ‘String’ cannot be used as an index type in Typescript. Type ‘String’ cannot be used as an index type in Typescript occurs when you use String(Starts with capital s) instead of string when trying to index array or object in Typescript. Let’s see with […]