---
agentTools:
  projectIndex: https://nativescript-batch.readme.io/llms.txt
---

# nextValue

Gets or sets the value for the next operation.

[block:code]
{
  "codes": [
    {
      "code": "import Batch = require(\"nativescript-batch\");\n\nvar b = Batch.newBatch(function(ctx) {\n    // ctx.prevValue = undefined\n    ctx.nextValue = \"TM\";\n}).then(function(ctx) {\n    // ctx.prevValue = \"TM\"\n    \n    // something that does NOT set\n    // ctx.nextValue property\n}).then(function(ctx) {\n    // ctx.prevValue = undefined\n    ctx.nextValue = \"MK\";\n}).then(function(ctx) {\n    // ctx.prevValue = \"MK\"\n    ctx.nextValue = \"YS\";\n}).then(function(ctx) {\n    // ctx.prevValue = \"YS\"\n});\n\nb.start();",
      "language": "javascript"
    }
  ]
}
[/block]