Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Modules: Remember All Strings Will Now Have a Property After You Use Require

/*mycoolmodule/index.js*/

String.prototype.a = 12345
let w = {one:"one", two:"two"};
module.exports = w;


/*routes/index.js */


var mymodule = require('mycoolmodule')

var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
let x = new String("XXX");
	console.log(x.a);
});
 
 
module.exports = router;

 
PREVIOUS NEXT
Tagged: #Remember #All #Strings #Will #Now #Have #Property #After #You #Use #Require
ADD COMMENT
Topic
Name
6+8 =