"Hard to believe they ported it in only 4 days."
Did you read the 2nd part of that sentence? Since they were able to use a program to translate the c++ into javascript, they didn't need to write much. Without that, it wouldn't have bee practical to rewrite the engine thing from c++ to javascript.
But ya i agree they likely spent more time then that to research the possibility, and then to test afterwards!