Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

The Science of Programming/SwayPresentations/Objects/Examples

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Examples How about with? function with(obj,$actions) { $actions . context = obj; force($actions); } Let's create an object: function f(x) { var y = x + 1; this;} var o = f(3); Now let's modify its slots: with (o) { x = 10; y = 13; } Did it work? inspect(o . x); inspect(o . y); Output: o . x is 10 o . y is 13 Next Previous Top