{"name":"typeName","operator":null,"title":"typeName","type":"command","url":"https://community.bistudio.com/wiki/typeName","revid":379033,"updated":"2026-09-22T13:56:05Z","groups":["Variables"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns the Data Type of an expression.\n\nThe type is returned as on of the following all-uppercase strings:\n- \"ARRAY\"\n- \"BOOL\"\n- \"CODE\"\n- \"CONFIG\"\n- \"CONTROL\"\n- \"DISPLAY\"\n- \"GROUP\"\n- \"OBJECT\"\n- \"SCALAR\" (and \"NaN\")\n- \"SCRIPT\"\n- \"SIDE\"\n- \"STRING\"\n- \"TEXT\"\n- Armed Assault v1.08 \"LOCATION\"\n- Arma 2 v1.00 \"TEAM_MEMBER\"\n- Arma 2 v1.00 \"NAMESPACE\"\n- Arma 2 v1.00 \"DIARY_RECORD\"\n- Arma 2 v1.00 \"TASK\"\n- Arma 3 v2.02 \"HASHMAP\"\n- Arma 3 v2.24 \"NetObject\"\nThey represent the available Data Types in Arma.\n\n> [!NOTE]\n> **Arma 3:** For type comparison, use isEqualType command instead.","syntaxes":[{"syntax":"typeName anything","since":null,"effect":null,"exec":null,"params":[{"name":"anything","type":"Anything","optional":false,"default":null,"description":null,"types":["Anything"],"since":null,"text":"anything: Anything"}],"returns":{"type":"String","types":["String"],"description":null,"text":"String"},"form":"unary","operator":null,"left":null,"right":{"text":"anything","types":["Anything"]}}],"examples":[{"text":"```sqf\n_msg = \"hello\"; _result = typeName _msg;  //_result will be \"STRING\"\n```","code":["_msg = \"hello\"; _result = typeName _msg;  //_result will be \"STRING\""]},{"text":"```sqf\n_unit = player; _result = typeName _unit; //_result becomes \"OBJECT\"\n```","code":["_unit = player; _result = typeName _unit; //_result becomes \"OBJECT\""]},{"text":"Values representing direct Data Types:\n\n```sqf\nhint typeName 0;                    // SCALAR\nhint typeName 1e39;                    // NaN\nhint typeName \"\";                    // STRING\nhint typeName true;                    // BOOL\nhint typeName [];                    // ARRAY\nhint typeName {};                    // CODE\nhint typeName scriptNull;            // SCRIPT (since Arma 3 v1.32)\nhint typeName objNull;                // OBJECT\nhint typeName grpNull;                // GROUP\nhint typeName controlNull;            // CONTROL\nhint typeName teamMemberNull;        // TEAM_MEMBER (since Arma 2 v1.00)\nhint typeName displayNull;            // DISPLAY\nhint typeName taskNull;                // TASK (since Arma 2 v1.00)\nhint typeName locationNull;            // LOCATION\nhint typeName sideUnknown;            // SIDE\nhint typeName text \"\";                // TEXT\nhint typeName configFile;            // CONFIG\nhint typeName configNull;            // CONFIG (since Arma 3 v1.54)\nhint typeName missionNamespace;        // NAMESPACE\nhint typeName diaryRecordNull;        // DIARY_RECORD (since Arma 3 v2.00)\nhint typeName createHashMap;        // HASHMAP (since Arma 3 v2.02)\nhint typeName netObjNull;            // NetObject (works as intended since Arma 3 v2.24)\n```","code":["hint typeName 0;\t\t\t\t\t// SCALAR\nhint typeName 1e39;\t\t\t\t\t// NaN\nhint typeName \"\";\t\t\t\t\t// STRING\nhint typeName true;\t\t\t\t\t// BOOL\nhint typeName [];\t\t\t\t\t// ARRAY\nhint typeName {};\t\t\t\t\t// CODE\nhint typeName scriptNull;\t\t\t// SCRIPT (since Arma 3 v1.32)\nhint typeName objNull;\t\t\t\t// OBJECT\nhint typeName grpNull;\t\t\t\t// GROUP\nhint typeName controlNull;\t\t\t// CONTROL\nhint typeName teamMemberNull;\t\t// TEAM_MEMBER (since Arma 2 v1.00)\nhint typeName displayNull;\t\t\t// DISPLAY\nhint typeName taskNull;\t\t\t\t// TASK (since Arma 2 v1.00)\nhint typeName locationNull;\t\t\t// LOCATION\nhint typeName sideUnknown;\t\t\t// SIDE\nhint typeName text \"\";\t\t\t\t// TEXT\nhint typeName configFile;\t\t\t// CONFIG\nhint typeName configNull;\t\t\t// CONFIG (since Arma 3 v1.54)\nhint typeName missionNamespace;\t\t// NAMESPACE\nhint typeName diaryRecordNull;\t\t// DIARY_RECORD (since Arma 3 v2.00)\nhint typeName createHashMap;\t\t// HASHMAP (since Arma 3 v2.02)\nhint typeName netObjNull;\t\t    // NetObject (works as intended since Arma 3 v2.24)"]},{"text":"```sqf\nif (typeName _this != \"ARRAY\") exitWith { hint \"_this is not an array!\" };\n// is the same as\nif (typeName _this != typeName []) exitWith { hint \"_this is not an array!\" };\n// same result but faster in Arma 3\nif !(_this isEqualType []) exitWith { hint \"_this is not an array!\" };\n```","code":["if (typeName _this != \"ARRAY\") exitWith { hint \"_this is not an array!\" };\n// is the same as\nif (typeName _this != typeName []) exitWith { hint \"_this is not an array!\" };\n// same result but faster in Arma 3\nif !(_this isEqualType []) exitWith { hint \"_this is not an array!\" };"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["isEqualTypeAll","isEqualType","isEqualTypeParams","isEqualTypeArray","isEqualTypeAny","typeOf","isKindOf","isClass","isArray","isNumber","isText","isNil","isNull"],"notes":[{"user":"Killzone_Kid","date":"2016-09-25T11:14:00Z","text":"typeName of nil is `ANY`, however this is not possible to test as script command is just ignored when any argument is nil."}],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Variables","Introduced with Armed Assault version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}