Can’t pass a range to a lambda using Let and Makearray functions

The construct of INDEX() >>:<<INDEX() will work when applied to ranges. Not to arrays AFAIK. It will lead to these errors. Maybe try something like: =LET(range,A1:D2,MAKEARRAY(ROWS(range),COLUMNS(range),LAMBDA(r,c,SUM(INDEX(range,r,SEQUENCE(c)))))) This would resemble the construct of your inital formula. However, in the linked question you have mentioned that you’d like to use SCAN() in combination with BYROW(). You have … Read more

Chrome console already declared variables throw undefined reference errors for let

This happens when you introduce the temporal dead zone to the global scope. As you might know, let declarations are hoisted but left uninitialised. Due to control flow, it can happen that a variable is never initialised: function …() { if (false) example; // would throw a ReferenceError if it was evaluated … // do … Read more

What causes the different behaviors between “var” and “let” when assign them a returned value of a function which throws an error

Declarations of var variables get hoisted – the variable name initialization gets hoisted to the top of the containing function (or, if no function, to the top of the outer block). So var withVar = (function() {throw ‘error!’})() is parsed by the interpreter as var withVar; withVar = (function() {throw ‘error!’})() The same is not … Read more