Dassault Systèmes interview question

Q. How to convert JS class to JSON.