Files

17 lines
508 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# TP.js — pushHistory() (satır 85)
[← TP.js](index.md) · [← Master](../../wiki.md)
```javascript
function pushHistory(states, name) {
var hist = parseHistory(states.getString(HISTORY_KEY));
// dedupe
var filtered = [name];
for (var i = 0; i < hist.length; i++) {
if (hist[i].toLowerCase() !== name.toLowerCase()) filtered.push(hist[i]);
if (filtered.length >= MAX_HISTORY) break;
}
states.setString(HISTORY_KEY, filtered.join(","));
}
```