I am converting my C# array to json in javascript on MVC view as below
var selectedPatientGroups = JSON.parse('[@(Model.SelectedPatientDiscountGroups != null ? string.Join(",", Model.SelectedPatientDiscountGroups) : string.Empty)]')
if Model.SelectedPatientDiscountGroups = string[]{ "abc","cd" } then I will get converted json object as
var selectedPatientGroups = [abc,cd]
but as json object I am expecting as ["abc","cd"]
I need best solution for this.
SelectedPatientDiscountGroups
array ofstring
?