From 650df1d575a507194688c40e980625a61b2fac07 Mon Sep 17 00:00:00 2001 From: Leilei332 Date: Mon, 8 Sep 2025 21:44:01 +0800 Subject: [PATCH] Deprecate $tw.utils.each --- boot/boot.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index acd9079ea4..6e613f778f 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -135,24 +135,13 @@ $tw.utils.isDate = (value) => value instanceof Date; Iterate through all the own properties of an object or array. Callback is invoked with (element,title,object) */ $tw.utils.each = function(object,callback) { - var next,f,length; if(object) { - if(Object.prototype.toString.call(object) == "[object Array]") { - for(f=0, length=object.length; f { + callback(element[1], element[0], object); + }); } } };