Drupal 8 : Get all available fields by a field type as an array.

The following code will return all the available fields as an array by a field type. You can pass the field type that you want to load within getFieldMapByFieldType() function.
Array - Array is a structure in which it stores multiple values in a single variable. It can be classified into three types say numeric ,associative and multidimensional array.