All posts by Christos Ploutarchou
Understanding *args and **kwargs in Python 3
Understanding *args In Python, the single-asterisk form of args can be used as a parameter to send a non-keyworded variable-length argument list to functions. It is worth noting that the asterisk () is the critical element here, as the word args is the established conventional idiom, though the language does not enforce it. Suppose we […]
Stop Using Square Brackets to Get a python Dictionary Values
A python dictionary is an unordered set of keys and values. That means : Each data point has an identifier (key) and a value. The keys must be unique to that dictionary — no repetitions. The keys have no explicit order — unlike a list. To define a dictionary, use curly braces and separate each […]
Mastering check data types in Javascript
This article will help you to check data types in Javascript whether a variable or parameter is a string, number, array, object, function, null & undefined, boolean, regexp, error or date. Table of contents How do you check if a variable is a String in Javascript How do you check if a variable is a […]
Best Way To Validate Email In Javascript
Javascript is one of the most trending programming language these days. Be it frontend development or backend development, Javascript used widely in almost every field of web development. While the development of any websites or applications using the Javascript, we have to create a contact form, signup form, sign in form, or any other type […]
How To Build Simple Node.js Rest APIs with Express, Sequelize & MySQL
We’ll be start to build a Node.js Rest API with Express, Sequelize & MySQL. Here we’ll use Sequelize for interacting with the MySQL instance. Required applications Docker is a set of platform as a service product that uses OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own […]
How to iterate over Javascript object properties
Here some very common tasks how to iterating over an JavaScript object properties If you have an object, you can’t just iterate it using map(), forEach() or a for..of loop. You will get the following errors: map() function will give you TypeError: items.map is not a function: forEach() function will give you TypeError: items.forEach is not a function: for..of will give you TypeError: items […]
Map vs forEach in JavaScript – What Is the Difference?
One of my most loved functions in JavaScript might be map() and forEach. They both started to exist since ECMAScript 5, ores5 in short. On that post, I am going to talk about the main difference between each and show you some examples of their usages. Basically, looping over an object in JavaScript counts on whether or not the […]
When (and why) you should use ES6 arrow functions — and when you shouldn’t
Arrow functions are undoubtedly one of the more popular features of ES6. They introduced a new way of writing concise functions. Here is a function how is written in ES5 syntax: Now, here is the same function expressed as an arrow function: It’s much shorter! We are able to omit the curly braces and the […]
Some Useful Node.js Internal Modules
1. OS JavaScript in Web browser cannot get the information about Operating System (OS) but node.js can os.type() : Shows the Operating Systems type os.uptime() : Shows pc runtime after last reboot os.hostname() : Shows the computer name os.release() : Shows OS version os.homedir() : Shows home directory path os.freemem () : Shows available RAM […]