As a puzzle I was given the following snippet of code yesterday with the question
Why does this give 773.06..?
var _ = 10, __ = 21, ___ = 38;
var _______ = { _: { "yo":_/___*_+___ }};
var ___________ = [[[{"heh":{"hehe":[[[[12,71,82,91]]]][0][0][0][1]}}]]];
var ____________ = ___________[0][0][0].heh.hehe*_+__+_______._.yo/_+___;
console.log(____________);
I can't remember the expected answer, but it was at least 800. A colleague looked at it briefly and said it was due to floating-point imprecision but I think that it should return 773.06..
What is the correct answer?
Tidied code
var a = 10, b = 21, c = 38;
var d = a/c*a+c;
var e = (71*a)+b+(d/a)+c;
console.log(e);