Answer the question
In order to leave comments, you need to log in
How to translate JavaScript functions, variables, etc into object methods in PhpStorm?
Hello.
Is there a quick way to translate the entire contents of a JS file (selection) into object elements?
Example:
var var1=null;
var var2="";
function foo(foovar){
var1 = var2;
}
function bar(barvar){
foo(barvar);
}
var SomeObj = {
_var1:null,
_var2:"",
foo:function(foovar){
this._var1 = this._var2;
},
bar:function(barvar){
this.foo(barvar);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question