A javascript based learning machine