0

I am getting input text box values in my angular ng-model as 903290,902020. I want to insert this in mysql using nodejs with sequelize , so for bulk create i need array. How to convert this above 903290,902020 into array [903290,902020]

1
  • modelName.split(',') Commented Nov 15, 2017 at 11:31

1 Answer 1

2

You can use the JavaScript split function for this.

var string = "903290,902020";
var split = string.split(",");

console.log(split)

Sign up to request clarification or add additional context in comments.

2 Comments

will i get this as array?
Yes, see the console output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.