What does this repeater-related code do?

This question is about an old, but very important posting about repeaters. Here is the link to the post: https://www.wix.com/velo/forum/tips-tutorials-examples/example-todomvc >

In this old post called, Example: TodoMVC, Yisrael put forth a nice and simple template for working with Repeaters, input and output. In this template he uses lots of shorthand code and some very complex (for me) code. After a few hours I am still struggling with two statements shown below. Can someone out there help me to follow and understand them?

let item = $w ( ‘#repeater1’ ). data . find ( _ => _ . id === itemId ); I get that the "" is used as a variable name. But what is going on in the chain of function/statements to the right of the “=”?

$item ( ‘#checkbox1’ ). checked = !! itemData . completed ; What does the right of the “=” mean in this context?

Thanks very much for helping.

let item = $w('#repeater1').data.find(_=>_._id === itemId);

This code finds the item in the Repeater that has the _id of itemId), by performing a find on the array of items (data) in the Repeater.

A double “bang”, or not, converts a non-boolean to a boolean. So, if the object is “falsey” (null, zero, empty, etc) the value is a boolean false, otherwise the value is a boolean true. It’s a more concise (albeit more confusing) way to ensure that a boolean value is being used.

Thanks. I think I understand the code a smidgen better but still lots of holes. It would be great if you could rewrite it in a more verbose form, more traditional with all the normal braces to make it easier to follow.

Chaining different functionality the way you have seems to me a definite “art form”.