unidata.js
function Fraction(n, d) {
	if(typeof(d) === "number") {
		this.denominator = d;
	} else {
		this.denominator = 1;
	}
	if(typeof(n) === "number") {
		this.numerator = n;
	} else if(typeof(n) === "string") {
		let slash = n.indexOf('/');
		if(slash > 0) {
			/**
			 *	The numerator of the fraction.
			 *
			 *	@type {number}
			 */
			this.numerator = Number.parseInt(n.substring(0, slash));
			/**
			 *	The denominator of the fraction.
			 *
			 *	@type {number}
			 *	@defaultvalue 1
			 */
			this.denominator = Number.parseInt(n.substring(slash + 1));
		} else {
			this.numerator = Number.parseFloat(n);
		}
	} else if((typeof(n) === "object") && (n instanceof Fraction)) {
		this.numerator = n.numerator;
		this.denominator = n.denominator;
	} else {
		throw new TypeError(`${n} must be a number or a string`);
	}
	/**
	 *	The numeric value of the fraction i.e., numerator divided by denominator.
	 *
	 *	@type {number}
	 */
	this.value = this.numerator / this.denominator;
}
function Fraction(n, d) {
	if(typeof(d) === "number") {
		this.denominator = d;
	} else {
		this.denominator = 1;
	}
	if(typeof(n) === "number") {
		this.numerator = n;
	} else if(typeof(n) === "string") {
		let slash = n.indexOf('/');
		if(slash > 0) {
			/**
			 *	The numerator of the fraction.
			 *
			 *	@type {number}
			 */
			this.numerator = Number.parseInt(n.substring(0, slash));
			/**
			 *	The denominator of the fraction.
			 *
			 *	@type {number}
			 *	@defaultvalue 1
			 */
			this.denominator = Number.parseInt(n.substring(slash + 1));
		} else {
			this.numerator = Number.parseFloat(n);
		}
	} else if((typeof(n) === "object") && (n instanceof Fraction)) {
		this.numerator = n.numerator;
		this.denominator = n.denominator;
	} else {
		throw new TypeError(`${n} must be a number or a string`);
	}
	/**
	 *	The numeric value of the fraction i.e., numerator divided by denominator.
	 *
	 *	@type {number}
	 */
	this.value = this.numerator / this.denominator;
}
function Fraction ( n , d ) { if ( typeof ( d ) === "number" ) { this . denominator = d ; } else { this . denominator = 1 ; } if ( typeof ( n ) === "number" ) { this . numerator = n ; } else if ( typeof ( n ) === "string" ) { let slash = n . indexOf ( '/' ) ; if ( slash > 0 ) { /**
			 *	The numerator of the fraction.
			 *
			 *	@type {number}
			 */ this . numerator = Number . parseInt ( n . substring ( 0 , slash ) ) ; /**
			 *	The denominator of the fraction.
			 *
			 *	@type {number}
			 *	@defaultvalue 1
			 */ this . denominator = Number . parseInt ( n . substring ( slash + 1 ) ) ; } else { this . numerator = Number . parseFloat ( n ) ; } } else if ( ( typeof ( n ) === "object" ) && ( n instanceof Fraction ) ) { this . numerator = n . numerator ; this . denominator = n . denominator ; } else { throw new TypeError ( ` ${ n } ` ) ; } /**
	 *	The numeric value of the fraction i.e., numerator divided by denominator.
	 *
	 *	@type {number}
	 */ this . value = this . numerator / this . denominator ; }
Represents a fraction i.e., a numerator and a denominator.

@class
@constructor
@param n {number|string} numerator or string representation of the fraction
@param d {number} (optional) denominator of the fraction
Represents a fraction i . e . a numerator and a denominator .