JSFiddle - React, Tailwind, and code Playground

JavaScript

// Set the singleton value to the return value of the self-
// executing function block.
var singleton = (function(){
 
    // Declare a private variable.
    var message = "Stop playing with your context!";

    this.getMessage = function(){
 
        return( message );
 
    };
 
 
    // Return this object reference.
    return( this );
 
}).call( {} );

// alert the singleton message.
alert( "Message:", singleton.getMessage());