Strategy example using JavaScript