Convert Object and String Javascript types between different styles