Skip to content

Commit

Permalink
Fix incorrect javascript. (#5163)
Browse files Browse the repository at this point in the history
  • Loading branch information
yukimotochern authored Sep 16, 2024
1 parent d2204b1 commit d78763e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions content/en/docs/languages/js/instrumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1615,16 +1615,16 @@ Observable counters can be used to measure an additive, non-negative,
monotonically increasing value.

```js
let events = [];
const events = [];

const addEvent = (name) => {
events = append(events, name);
events.push(name);
};

const counter = myMeter.createObservableCounter('events.counter');

counter.addCallback((result) => {
result.observe(len(events));
result.observe(events.length);
});

//... calls to addEvent
Expand All @@ -1636,10 +1636,10 @@ Observable UpDown counters can increment and decrement, allowing you to measure
an additive, non-negative, non-monotonically increasing cumulative value.

```js
let events = [];
const events = [];

const addEvent = (name) => {
events = append(events, name);
events.push(name);
};

const removeEvent = () => {
Expand All @@ -1649,7 +1649,7 @@ const removeEvent = () => {
const counter = myMeter.createObservableUpDownCounter('events.counter');

counter.addCallback((result) => {
result.observe(len(events));
result.observe(events.length);
});

//... calls to addEvent and removeEvent
Expand Down

0 comments on commit d78763e

Please sign in to comment.