6 console.log -> alert
source | link

JavaScript

The ASCII code for *, which for most programmers stands for "everything", is 42. +!"The End of the Universe" evaluates to 0.

String.prototype.answer = function() { console.logalert(this.charCodeAt(+!"The End of the Universe")); };
'*'.answer();

JavaScript

The ASCII code for *, which for most programmers stands for "everything", is 42. +!"The End of the Universe" evaluates to 0.

String.prototype.answer = function() { console.log(this.charCodeAt(+!"The End of the Universe")); };
'*'.answer();

JavaScript

The ASCII code for *, which for most programmers stands for "everything", is 42. +!"The End of the Universe" evaluates to 0.

String.prototype.answer = function() { alert(this.charCodeAt(+!"The End of the Universe")); };
'*'.answer();
5 Syntax coloring
source | link

JavaScript

The ASCII code for *, which for most programmers stands for "everything", is 42. +!"The End of the Universe" evaluates to 0.

String.prototype.answer = function() { console.log(this.charCodeAt(+!"The End of the Universe")); };
'*'.answer();
String.prototype.answer = function() { console.log(this.charCodeAt(+!"The End of the Universe")); };
'*'.answer();

JavaScript

The ASCII code for *, which for most programmers stands for "everything", is 42. +!"The End of the Universe" evaluates to 0.

String.prototype.answer = function() { console.log(this.charCodeAt(+!"The End of the Universe")); };
'*'.answer();

JavaScript

The ASCII code for *, which for most programmers stands for "everything", is 42. +!"The End of the Universe" evaluates to 0.

String.prototype.answer = function() { console.log(this.charCodeAt(+!"The End of the Universe")); };
'*'.answer();
4 Changed the boring charCodeAt(0) to something more interesting.
source | link

JavaScript

The ASCII code for *, which for most programmers stands for "everything", is 42. +!"The End of the Universe" evaluates to 0.

String.prototype.answer = function() { console.log(this.charCodeAt(0+!"The End of the Universe")); };
'*'.answer();

JavaScript

The ASCII code for *, which for most programmers stands for "everything", is 42.

String.prototype.answer = function() { console.log(this.charCodeAt(0)); };
'*'.answer();

JavaScript

The ASCII code for *, which for most programmers stands for "everything", is 42. +!"The End of the Universe" evaluates to 0.

String.prototype.answer = function() { console.log(this.charCodeAt(+!"The End of the Universe")); };
'*'.answer();
3 Improved formatting
source | link
2 Added a clue as to how the solution works.
source | link
1
source | link