Representative Line: An Array of WHY |

Reader Jeremy sends us this baffling JavaScript: "Nobody on the team knows how it came to be. We think all 'they' wanted was a sequence of numbers starting at 1, but you wouldn't really know that from the code."
var numbers = new Array(maxNumber)
.join()
.split(',')
.map(function(){return ++arguments[1]});
The end result: an array of integers starting at 1 and going up to maxNumber. This is probably the most head-scratchingest way to get that result ever devised.
| Комментировать | « Пред. запись — К дневнику — След. запись » | Страницы: [1] [Новые] |