vHive Interview Question

How to implement singleton sync function in js