How can I split a string?

I have a string str=“10|12|22|” and a I must split it in an array.
Generally I use var array=str.split(“|”);
How can I do that in Wix Code Javascript?

Tks in advanced.

Hi!

I tried this

$w.onReady(function () {
	var str="10|12|22|";
	console.log(str.split("|"));
});

And this seems to work actually. WixCode support all general JS operation, String, Math and others

Tks for your answer.
Its true that your code works fine just below ONREADY.
But doesn´t works inside the query result.
Look at the “split line”… it has a yellow mark warning error.
And I need in that place because is there that I get data.
How can I do that?

Sorry, the variable was wrong.