JavaScript Null Coalesce

2016-06-07

Use || similar to ?? in C#

example (mvc)


var previousRangeSelection = @(Html.Raw(JsonConvert.SerializeObject(TempData["rangeType"]))) || "default"; 

This entry was posted in Javascript and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *