Ramda.js R.join() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
List

Definition

R.join(separator, list) puts the separator between every item and combines them into one string (official Ramda docs). It is the native Array.prototype.join with the separator first and the list last, so it curries and fits in pipelines.

Added in v0.1.0: R.join is stable — not deprecated, experimental, or non-standard. Note: it calls the list’s own .join() method, so a string, Set, or null throws instead of joining.

Syntax

Call R.join. Start with this line.

Ramda
R.join(separator, list) or R.join(separator)(list)
CallWhat it does
R.join(separator, list) or R.join(separator)(list)Primary signature.
R.join(...)Call the list helper.

Prefer import { join } from "ramda" when you want a named import.

Library declarations
Ramda
R.join(separator, list) or R.join(separator)(list)

Parameters

ParameterDescription
separatorRequired. Text placed between items (a number also works)
listOptional. The array to combine; omit it to get a reusable function

Return Value

Return ValueDescription
*A new string; the list is not changed

Ramda Examples

Example 1 — Official Samples

Make a reusable space joiner, then join numbers with a pipe — both samples from the Ramda docs.

Ramda
const spacer = R.join(' ');

console.log(spacer(['a', 2, 3.4]));      // 'a 2 3.4'
console.log(R.join('|', [1, 2, 3]));     // '1|2|3'
Try It Yourself

How It Works

  1. Curried. R.join(' ') has only the separator, so it returns a function called spacer.
  2. Mixed items. spacer turns 'a', 2, and 3.4 into text and puts a space between them.
  3. Both arguments. R.join('|', [1, 2, 3]) runs straight away and returns '1|2|3'.
  4. Between only. Three items get two separators — nothing at the start or end.

Example 2 — Readable List of Names

Pull one field out of each record and show the values as a comma-separated list.

Ramda
const users = [{ name: 'Ada' }, { name: 'Linus' }, { name: 'Grace' }];

const listNames = R.pipe(R.pluck('name'), R.join(', '));

console.log(listNames(users));   // 'Ada, Linus, Grace'
Try It Yourself

How It Works

  1. Pluck. R.pluck('name') turns the records into ['Ada', 'Linus', 'Grace'].
  2. Join. R.join(', ') puts a comma and a space between the names.
  3. Pipeline. R.pipe runs the two steps left to right, so listNames takes records and returns text.
  4. Why it fits. Because the list comes last, R.join(', ') drops into the pipe without a wrapper function.

Example 3 — Build a URL Slug

Split a title into words, lowercase them, and join them with dashes.

Ramda
const toSlug = R.pipe(
  R.split(' '),
  R.map(R.toLower),
  R.join('-')
);

console.log(toSlug('Learn Ramda Join'));   // 'learn-ramda-join'
Try It Yourself

How It Works

  1. Split. R.split(' ') turns the title into ['Learn', 'Ramda', 'Join'].
  2. Lowercase. R.map with R.toLower gives ['learn', 'ramda', 'join'].
  3. Join. R.join('-') glues the words with dashes: 'learn-ramda-join'.
  4. Opposites. R.split and R.join undo each other, so you can split, change the pieces, and join again.

Example 4 — Build a Query String

Join each key with its value using =, then join the pairs with &.

Ramda
const params = { q: 'ramda', page: 2 };

const query = R.join('&', R.map(R.join('='), R.toPairs(params)));

console.log(query);   // 'q=ramda&page=2'
Try It Yourself

How It Works

  1. Pairs. R.toPairs turns the object into [['q', 'ramda'], ['page', 2]].
  2. Inner join. R.map(R.join('=')) joins each pair: ['q=ramda', 'page=2'].
  3. Outer join. R.join('&') combines the pairs into 'q=ramda&page=2'.
  4. Real URLs. This does not encode spaces or symbols; use URLSearchParams or encodeURIComponent for user input.

Example 5 — R.join vs R.intersperse vs Native join

Same list, same separator — see which return a string and which keep an array.

Ramda
const nums = [1, 2, 3];

console.log(R.join('-', nums));          // '1-2-3'
console.log(R.intersperse('-', nums));   // [1, '-', 2, '-', 3]
console.log(nums.join('-'));             // '1-2-3'
Try It Yourself

How It Works

  1. R.join. Returns one string, '1-2-3'.
  2. R.intersperse. R.intersperse puts the dash between items but keeps an array.
  3. Native. nums.join('-') gives the same string as R.join — Ramda calls it for you.
  4. Choose. Use R.join in pipelines and native .join for one-off calls on a known array.

Browser & Runtime Support

R.join() has been in Ramda since v0.1.0. It calls the list’s native Array.prototype.join, which every JavaScript engine has supported since the first edition of the language.

✓ Ramda 0.1.0+ · Any JS runtime

Ramda.js R.join()

The UMD build (ramda.min.js) is compiled to ES5 syntax, so it runs in Chrome, Firefox, Safari, and Edge. Via npm it works in Node.js, Deno, and Bun with require or import.

100% Any Ramda version
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
R.join() Universal

Bottom line: Safe in every Ramda version and every modern or legacy runtime. Load ramda.min.js from a CDN in the browser, or npm install ramda for Node, Deno, and Bun. These labs load [email protected].

Frequently Asked Questions

R.join(separator, list) puts the separator between every item and combines them into one string. The official samples are R.join(' ')(['a', 2, 3.4]), which is 'a 2 3.4', and R.join('|', [1, 2, 3]), which is '1|2|3'.
It gives the same string. R.join simply calls list.join(separator), but takes the separator first and the list last, so R.join(', ') can be saved as a reusable function or dropped into R.pipe.
An empty list gives an empty string ''. A single item gives that item as a string with no separator, because there is no gap to fill.
R.join calls the list's own join method, and strings do not have one, so R.join('-', 'abc') throws a TypeError. Split the string into an array first, for example with R.split('', 'abc').
Both put a separator between items, but R.intersperse returns an array, such as [1, '-', 2, '-', 3], while R.join returns a single string, such as '1-2-3'.
No. R.join has been part of Ramda since v0.1.0 and is stable. It is not deprecated, experimental, or non-standard.

Next: R.last()

Get the final item of a list or the last character of a string.

R.last() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful