Add Solution 8 for Javascript