Versions of InDesign

InDesign 1.0 (codenamed Shuksan, then K2): August 31, 1999
InDesign 1.0J (codenamed Hotaka): Japanese support
InDesign 1.5 (codenamed Sherpa): April 2001;
InDesign 2.0 (codenamed Annapurna): January 2002
InDesign CS (codenamed Dragontail) (3.0): October 2003
InDesign CS2 (4.0) (codenamed Firedrake): May 2005
InDesign Server (codenamed Bishop): October 2005
InDesign CS3 (5.0) (codenamed Cobalt): April 2007
InDesign CS3 Server (codenamed Xenon): May 2007
InDesign CS4 (6.0) (codenamed Basil): October 2008
InDesign CS4 Server (codenamed Thyme)
InDesign CS5 (7.0) (codenamed Rocket): April 2010
InDesign CS5.5 (7.5) (codenamed Odin): April 2011
InDesign CS6 (8.0) (codenamed Athos): 23 April 2012
InDesign CC (9.2) (codenamed Citius): 15 January 2014
InDesign CC 2014 (10) (codenamed Sirius): 18 June 2014
InDesign CC 2014.1 (10.1): 6 Oct 2014
InDesign CC 2014.2 (10.2): 11 Feb 2015
InDesign CC 2015 (11.0): 15 Jun 2015
InDesign CC 2015.1 (11.1): 11 Aug 2015
InDesign CC 2015.2 (11.2): 30 Nov 2015
InDesign CC 2015.4 (11.3): 20 Jun 2016
InDesign CC 2017(12): 2 Nov 2016
InDesign CC 2018.1 (13.0): 18 Oct 2017

How to get version of InDesign application

This line returns a number

var appVersion = Number(String(app.version).split(".")[0]);

This function returns text: something like 'CC 2017'

Main();

function Main() {
	var version = GetAppVersionName();
}

function GetAppVersionName() {
	var appPath = app.filePath.fsName;
	var tempArr = appPath.split("\\");
	var appName = tempArr[tempArr.length - 1].replace(/^Adobe InDesign\s/, "");
	return appName;
}