The present invention is a gas detector and method for using the gas detector for detecting and identifying volatile organic and/or volatile inorganic substances present in unknown vapors in an environment. The gas detector comprises a sensing means and a detecting means for detecting electrical capacitance variance of the sensing means and for further identifying the volatile organic and volatile inorganic substances. The sensing means comprises at least one sensing unit and a sensing material allocated therein the sensing unit. The sensing material is an ionic liquid which is exposed to the environment and is capable of dissolving a quantity of said volatile substance upon exposure thereto. The sensing means constitutes an electrochemical capacitor and the detecting means is in electrical communication with the sensing means.