---
title: "js cache property access"
description: "Cache object property lookups in hot paths."
type: skill
canonical_url: https://claudary.paisolsolutions.com/skills/js-cache-property-access
source: "Claudary"
difficulty: intermediate
author: "Claude Code Knowledge Pack"
date: 2026-07-10T11:30:22.788Z
license: CC-BY-4.0
attribution: "js cache property access — Claudary (https://claudary.paisolsolutions.com/skills/js-cache-property-access)"
---

# js cache property access
Cache object property lookups in hot paths.

## Overview

---
title: Cache Property Access in Loops
impact: LOW-MEDIUM
impactDescription: reduces lookups
tags: javascript, loops, optimization, caching
---

## Cache Property Access in Loops

Cache object property lookups in hot paths.

**Incorrect (3 lookups × N iterations):**

```typescript
for (let i = 0; i < arr.length; i++) {
  process(obj.config.settings.value)
}
```

**Correct (1 lookup total):**

```typescript
const value = obj.config.settings.value
const len = arr.length
for (let i = 0; i < len; i++) {
  process(value)
}
```

---

Source: [Claudary](https://claudary.paisolsolutions.com/skills/js-cache-property-access) · https://claudary.paisolsolutions.com
