Trimmed lower: {state.text.trim().toLowerCase()}
{/* Chain with reactive argument */}Contains search:{" "} {state.text.toLowerCase().includes(state.searchTerm.toLowerCase())}
{/* Longer chain */}Processed:{" "} {state.text.trim().toLowerCase().replace("old", "new").toUpperCase()}
Count above threshold:{" "} {state.items.filter((x) => x > state.threshold).length}
{/* Filter then map */}Double filter count:{" "} {state.items.filter((x) => x > state.start).filter((x) => x < state.end ).length}
Sliced items: {state.items.slice(state.start, state.end).join(", ")}
{/* String methods with reactive args */}Starts with:{" "} {state.names.filter((n) => n.startsWith(state.prefix)).join(", ")}
{/* Array find with reactive predicate */}First match: {state.names.find((n) => n.includes(state.searchTerm))}
Total with discount: {state.prices.reduce( (sum, price) => sum + price * (1 - state.discount), 0, )}
{/* Method result used in computation */}Average * factor:{" "} {(state.items.reduce((a, b) => a + b, 0) / state.items.length) * state.factor}
Formatted price: {(state.prices[0]! * (1 - state.discount)).toFixed(2)}
{/* Method on conditional result */}Conditional trim:{" "} {(state.text.length > 10 ? state.text : state.prefix).trim()}
{/* Method chain on computed value */}Complex:{" "} {(state.text + " " + state.prefix).trim().toLowerCase().split(" ") .join("-")}
Active adults:{" "} {state.users.filter((u) => u.age >= state.minAge && u.active).length}
{/* Map with conditional logic */}Has adults:{" "} {state.users.some((u) => u.age >= state.minAge) ? "Yes" : "No"}
All active: {state.users.every((u) => u.active) ? "Yes" : "No"}
Length sum: {state.text.trim().length + state.prefix.trim().length}
{/* Method result in comparison */}Is long: {state.text.trim().length > state.threshold ? "Yes" : "No"}
{/* Multiple method results combined */}Joined: {state.words.join(state.separator).toUpperCase()}