Jump to content

MediaWiki talk:Gadget-speedy.js

From translatewiki.net
Latest comment: 6 days ago by Tacsipacsi in topic formatversion=2

formatversion=2

@Jon Harald Søby: If you used formatversion: 2, you could replace data.query.pages[ '5504159' ] with data.query.pages[ 0 ], avoiding the hardcoded page ID, since format version 2 returns an array, not an object keyed by page ID. I think deletion and undeletion changes the page ID, so avoiding hardcoding could avoid silent breakage in case someone accidentally deletes the template.

By the way, why do you use let and not const? If it’s browser support, I don’t think you’re right: both are included in ES6 and have long been supported; actually, according to MDN, const has been supported slightly longer than let. —Tacsipacsi (talk) 22:14, 2 September 2025 (UTC)Reply