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
for example , topic "enter" and "entering",when I try to clear the topic "enter",it would clear topic 'entering' at the same time. I am quite confused why use 'indexOf' instead of '===',below is the method.
PubSub.clearSubscriptions = function clearSubscriptions(topic){
var m;
for (m in messages){
if (messages.hasOwnProperty(m) && m.indexOf(topic) === 0 / * why use indexOf here ?*/){
delete messages[m];
}
}
};
The text was updated successfully, but these errors were encountered:
for example , topic "enter" and "entering",when I try to clear the topic "enter",it would clear topic 'entering' at the same time. I am quite confused why use 'indexOf' instead of '===',below is the method.
The text was updated successfully, but these errors were encountered: