The JavaScript representer applies the following normalizations:
All comments are removed. The following examples are equivalent:
/**
* Returns the string literal 'hi there' just to say hello
* @return [String]
*/
function hello(/* nothing*/) {
// just return it
return 'hi there';
}function hello() {
return 'hi there';
}When the code is represented, it's order is significant, but its physical location is not. This means that whitespace is normalized. The following examples are equivalent:
function hello() {
return 'hello world';
}function hello() {
return 'hello world';
}function hello() {
return 'hello world';
}Identifiers are normalized to a placeholder value.
const MY_CONSTANT = 42;
function answer(multiplier, addition = 1) {
return MY_CONSTANT * multiplier + addition;
}const PLACEHOLDER_1 = 42;
function PLACEHOLDER_2(PLACEHOLDER_3, PLACEHOLDER_4 = 1) {
return PLACEHOLDER_1 * PLACEHOLDER_3 + PLACEHOLDER_4;
}