You should've picked a better example, like something in a programming language for adults. Say, C, ASM, C++, LISP, Haskell, frickin Erlang, R, something that isn't built for the lowest common denominator.
I may have agreed 5-10 years ago, but JavaScript has come along way.
Maybe if he had presented it in a more modern style?
(I threw this together quickly, there may be errors)
Code:
var mysertyUtil = Object.create(Object.prototype, {
version: {
writable: false,
configurable: false,
value: "0.0.1"
},
/**
* Does Mysertious things.
*/
mysteryFunction: {
writable: false,
configurable: false,
enumerable: true,
value: function(workingStr) {
"use strict";
workingStr = workingStr.toUpperCase();
workingStr = workingStr.replace(/\s+/g,"");
var numcharArray = new Array();
for(x=0;x<workingStr.length;x++) {
numcharArray[x] = workingStr.charCodeAt(x) - 65;
}
for(x=0;x<numcharArray.length;x++) {
if(numcharArray[x] > 25) {
alert("Invalid input.");
return null;
}
}
return numcharArray;
}
});
BTW, you're not half-replicating any data structure, you're talking way over your own abilities here bro. This looks like a poor mans attempt at encryption converting the unicode to the numeric placement of characters in the alphabet -1.
Bonus points for well-formatted code though. I'm not a fan of the tab indent, I prefer the 2 space indent, but that's really a style choice.
We don't need to get into programmer-DragonBallZ... I don't think this was a full example of his "true power". His point was that someone with basic understanding of syntax and logic progression should be able to read that. An ability he doesn't believe Gin has.