An air conditioner, comprising: a compressor compressing a refrigerant; an outdoor heat exchanger performing a heat exchange between outdoor air and the refrigerant, being disposed outdoors and connected to the compressor; an indoor heat exchanger performing a heat exchange between indoor air and the refrigerant, being disposed indoors and connected to the compressor and the outdoor heat exchanger; an electronic component box having electronic components accommodated therein, being disposed outdoors together with the outdoor heat exchanger; an outlet pipe connected to the compressor so that the refrigerant exhausted from the compressor flows therein; a 4-way valve connected to the outlet pipe so as to guide, to the outdoor heat exchanger, the refrigerant compressed in the compressor and exhausted through the outlet pipe in a cooling operation of the air conditioner and to guide, to the indoor heat exchanger, the refrigerant compressed in the compressor and exhausted through the outlet pipe in a heating operation of the air conditioner; and a gas pipe connecting the 4-way valve and the indoor heat exchanger therethrough, characterized by further comprising: a first electronic component box heat exchanger and a second electronic component box heat exchanger provided in the electronic component box; a first electronic component box inlet pipe connected to the first electronic component box heat exchanger, being branched from the gas pipe; a second electronic component box inlet pipe connected to the second electronic component box heat exchanger, being branched from the outlet pipe; a first electronic component box valve disposed on the first electronic component box inlet pipe and opened in the cooling operation of the air conditioner such that the refrigerant flows to cool the electronic component box in the cooling operation of the air conditioner; and a second electronic component box valve disposed on the second electronic component box inlet pipe and opened in the heating operation of the air conditioner such that the refrigerant flows to heat the electronic component box in the heating operation of the air conditioner. a compressor compressing a refrigerant; an outdoor heat exchanger performing a heat exchange between outdoor air and the refrigerant, being disposed outdoors and connected to the compressor; an indoor heat exchanger performing a heat exchange between indoor air and the refrigerant, being disposed indoors and connected to the compressor and the outdoor heat exchanger; an electronic component box having electronic components accommodated therein, being disposed outdoors together with the outdoor heat exchanger; an outlet pipe connected to the compressor so that the refrigerant exhausted from the compressor flows therein; a 4-way valve connected to the outlet pipe so as to guide, to the outdoor heat exchanger, the refrigerant compressed in the compressor and exhausted through the outlet pipe in a cooling operation of the air conditioner and to guide, to the indoor heat exchanger, the refrigerant compressed in the compressor and exhausted through the outlet pipe in a heating operation of the air conditioner; and a gas pipe connecting the 4-way valve and the indoor heat exchanger therethrough, characterized by further comprising: a first electronic component box heat exchanger and a second electronic component box heat exchanger provided in the electronic component box; a first electronic component box inlet pipe connected to the first electronic component box heat exchanger, being branched from the gas pipe; a second electronic component box inlet pipe connected to the second electronic component box heat exchanger, being branched from the outlet pipe; a first electronic component box valve disposed on the first electronic component box inlet pipe and opened in the cooling operation of the air conditioner such that the refrigerant flows to cool the electronic component box in the cooling operation of the air conditioner; and a second electronic component box valve disposed on the second electronic component box inlet pipe and opened in the heating operation of the air conditioner such that the refrigerant flows to heat the electronic component box in the heating operation of the air conditioner. a first electronic component box heat exchanger and a second electronic component box heat exchanger provided in the electronic component box; a first electronic component box inlet pipe connected to the first electronic component box heat exchanger, being branched from the gas pipe; a second electronic component box inlet pipe connected to the second electronic component box heat exchanger, being branched from the outlet pipe; a first electronic component box valve disposed on the first electronic component box inlet pipe and opened in the cooling operation of the air conditioner such that the refrigerant flows to cool the electronic component box in the cooling operation of the air conditioner; and a second electronic component box valve disposed on the second electronic component box inlet pipe and opened in the heating operation of the air conditioner such that the refrigerant flows to heat the electronic component box in the heating operation of the air conditioner.