You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this is a case that only happens some of the time, then why does the code always call the - toString - method? And if - value - is "falsey" (e.g. an empty string, 0, null, etc.) then it will be passed to the - html - method (which sets the innerHTML property of the element)?
The intent of the code is just not clear. For example, what is allowed for the - value - argument? For another, what is supposed to happen if it is a disallowed value (e.g. assume that setting the innerHTML property to "null" is not intended). The comment isn't helping either; if anything, it makes the intent less clear.
// In case value is a TrustedValueHolderType, sometimes it
// needs to be explicitly called into a string in order to
// get the HTML string.
element.html(value && value.toString());
The text was updated successfully, but these errors were encountered:
If this is a case that only happens some of the time, then why does the code always call the - toString - method? And if - value - is "falsey" (e.g. an empty string, 0, null, etc.) then it will be passed to the - html - method (which sets the innerHTML property of the element)?
The intent of the code is just not clear. For example, what is allowed for the - value - argument? For another, what is supposed to happen if it is a disallowed value (e.g. assume that setting the innerHTML property to "null" is not intended). The comment isn't helping either; if anything, it makes the intent less clear.
// In case value is a TrustedValueHolderType, sometimes it
// needs to be explicitly called into a string in order to
// get the HTML string.
element.html(value && value.toString());
The text was updated successfully, but these errors were encountered: