Javascript: call object method using string only

This code doesn’t work.

var Modal = {
    init: function() {
var objMethod = "Modal.init";

I saw some answers that it can be called using this but I want to know how it can be called without using the object.


Thank you!

95 thoughts on “Javascript: call object method using string only”

  1. 368805 764055Aw, this became an extremely good post. In thought I would like to set up writing like that additionally – taking time and actual effort to generate a terrific article but what / issues I say I procrastinate alot by means of no means appear to get something completed. 450416


Leave a Comment