Skip to content

Instantly share code, notes, and snippets.

@dlOuOlb
Created January 1, 2024 06:16
Show Gist options
  • Save dlOuOlb/c74571099589364ca34ae3ce013f2528 to your computer and use it in GitHub Desktop.
Save dlOuOlb/c74571099589364ca34ae3ce013f2528 to your computer and use it in GitHub Desktop.
Explicitly ignoring a return value.
'use strict';
/** This class provides a static property `void` which just __ignores__ any assigned value. */
export default class extends null
{
static get void( ) { return; }
static set void(_) { return; }
}
@dlOuOlb
Copy link
Author

dlOuOlb commented Feb 28, 2024

Just use the void operator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment