Send Parameters to POST Request | FastAPI

How to pass parameters in POST request in FastAPI ? Unlike GET request where you pass data as query string, in POST request you send the data in request body. Let’s first create a POST endpoint and it’s corresponding method. from fastapi import FastAPI my_app = FastAPI() @my_app.post("/getInformation") def getInformation(): return { "status" : "SUCCESS", "data" : [] } To pass request data object, you need to create a class of the data object that you intend to pass as POST body request. [Read More]

5 Best Ruby on Rails Gems You Need in 2021

HTML, SQL, and CSS are just a few examples of computer languages that don’t cover both the backend and the frontend. The RoR language, on the other hand, encompasses both ends and allows developers to create a complete web application. Rails, created in the Ruby programming language, is one of the most popular web frameworks, and its practical approach has revolutionized the web development industry. With Rails, you have access to all of the functions you’ll need to create a web app. [Read More]

Check Angular Version

Check your Angular Version

You can check your Angular and Angular CLI version using the following command,

ng --version

It should give you a detailed info about your Angular and related software versions.

Angular CLI: 12.1.0
Node: 14.17.1
Package Manager: npm 6.14.13
OS: win32 x64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1201.0 (cli-only)
@angular-devkit/core         9.1.0
@angular-devkit/schematics   9.1.0
@schematics/angular          12.1.0 (cli-only)

Check Any Value in Array Satisfy Condition | JavaScript

How to Check Any Value in Array Satisfy Condition Using JavaScript ?

To check if any value in JavaScript array satisfies the condition you can use Array.prototype.some() method. It returns true if any item in array satisfies the condition else returns false.

let data = [1,2,3,4,5,7];
let val = data.some(item => item > 6);
if(val){
	console.log('Numbers found greater than 6 ');
} else{
	console.log('No Numbers greater than 6 ');
}
// - "Numbers found greater than 6 "

Check Every Value in Array Satisfy Condition | JavaScript

How to Check Every Value in Array Satisfy Condition Using JavaScript ?

To check every value in JavaScript array you can use Array.prototype.every() method. It returns true if each item in array satisfies the condition else false.

let data = [1,2,3,4,5];
let val = data.every(item => item < 6);
if(val){
  console.log('Numbers less than 6 ');
} else{
  console.log('Numbers greater than 6 ');
}
// "Numbers less than 6 "

Concatenate String JavaScript

Concatenate String in JavaScript. Using + Operator You can use + operator to concatenate strings in JavaScript. let str1 = "Hello"; let str2 = "World"; console.log(str1 + " " + str2); // - "Hello World" Using Template Literals Template literals can also be used to concat two or more strings. let str1 = "Hello"; let str2 = "World"; console.log(`${str1} ${str2}`); // - "Hello World" Using String Concat String has an in built method called concat to concatenate string. [Read More]

Convert Date to UTC | JavaScript

How to convert date to UTC format in JavaScript?

new Date() will give you the current date and time in JavaScript. To convert the local date and time to UTC string format you can make use of the toUTCString() method.

let currentDate = new Date();
let utc = currentDate.toUTCString();
console.log(utc);
// "Mon, 26 Jul 2021 18:23:10 GMT"