M
M
Makcimka2021-01-22 17:19:07
React
Makcimka, 2021-01-22 17:19:07

How to export code in React?

I have an application created using create-react-app, I want to write the algorithm code in VKScript format separately in a file (this is the execute method )
for example:

var a=API.users.get({"user_ids":"7785521,197618501,23242830,124183392,4344,106908,34192,69266","fields":"online"});
var i=0;
var k = a.length;
var b = {};
while(i < k) {
if(a[i].online == 0 ){b.push(a[i]);}
i = i+1;
}
return b;

How can I export all this code into a single variable as a string? The fact is that writing code in quotes or enclosed in an apostrophe is not convenient.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question