$options.splice($options.indexOf('option7'), 1);
$options.splice($options.indexOf('option5'), 1);
$options.splice($options.indexOf('option4'), 1);
$options.splice($options.indexOf('option3'), 1);
$options.splice($options.indexOf('option2'), 1);
$options.splice($options.indexOf('option1'), 1);
By A "senior" developer, 2018-02-19 16:49:52
if (botCount < botCount)
    this.reconnect();
}

My friend wrote this code recently

By Anonymous, 2017-12-13 17:47:25
<div class="scrollContent">
	{foreach $animations as $index => $a}
		{if $index > 2}
			{if $a.filename == '9_1447691013_3726.png'}
			{else}
				{if $a.filename == '9_1423150010_6441.png'}
				{else}
					{if $a.filename == '9_1423149959_5909.png'}
					{else}
						{if $a.filename == '9_1423149908_5874.png'}
						{else}
							{if $a.filename == '9_1528213223_6374.jpg'}
							{else}
								{if $a.filename == '9_1527670984_3732.jpg'}
								{else}

							<div class="spotlightFrame frame{$index+1} contains1" data-index="{$index}">
								{if $a.link}<a href="{$a.link}">{/if}
								<img src="/upload/{$a.filename}" alt="{$a.title}" />
								{if $a.link}</a>{/if}
							</div>

								{/if}
							{/if}
						{/if}
					{/if}
				{/if}
			{/if}
		{/if}
	{/foreach}
</div>

Handovers are great.

By Anonymous, 2018-07-09 14:50:36
class FileReader extends EventTarget(...READER_EVENTS) {
    // [...]
    readAsArrayBuffer() {
        throw new Error('FileReader.readAsArrayBuffer is not implemented');
    }
}

React Native's way of saying they don't support FileReader.readAsArrayBuffer()

By Aurovik, 2018-12-12 12:50:22
// What they did:
var serverCommands = {};
for(var each in commandList.general)
    (dmCommands[commandList.general[each].type] ? dmCommands[commandList.general[each].type] +=
    (config.prefix + each + (commandList.general[each].args ? ' ' + commandList.general[each].args : '') +
    ': ' + commandList.general[each].description + '\n') : (dmCommands[commandList.general[each].type] =
    '\u200B'+ config.prefix + each + (commandList.general[each].args ? ' ' + commandList.general[each].args : '') +
    ': ' + commandList.general[each].description + '\n'))

// What they should've done:
let srvrCmds = new Map();
let gldCmds = commandList[message.guild.id];
for (let each in gldCmds) {
    const cur = gldCmds[each];
    const text = `${config.prefix + each + (cur.args ? " " + cur.args : "")}: ${cur.description}\n`;
    const srvrCmdType = srvrCmds.get(cur.type);
    srvrCmds.set(cur.type, (srvrCmdType || "\u200B") + text);
}
By Anonymous, 2018-01-18 05:57:37
// powtierdzenie decyzji
function zapytaj(pytanie){
	if(confirm(pytanie)) return true
	else return false;
}
By first year student, 2018-10-02 21:30:46
		roots.push(resolver(Config.root, `${pageDir}${path.sep}${page}${path.sep}${page}.html`));
By Anonymous, 2023-04-01 10:39:37

class Timer extends React.Component{
    state ={
        time: 10
    };
    setInvt = () =>{
        let t = this.state.time
        if(t<=1){
            clearInterval(this.invertal)
        }
        this.setState({time: t-1})
    }
    componentDidMount(){
        this.invertal = setInterval(this.setInvt, 1000)
    }

    render(){
        return (<label>{this.state.time}</label>)
    }
}

export {Timer}
By Anonymous, 2021-07-30 21:13:46
const setFormFlag(state){
    state.formFlag ? state.formFlag = false : state.formFlag = true;
}
By Apeiron, 2018-07-27 20:43:23
if (cookiesBannerHeight !== 0 && isMobile) {
      style = {
        top: cookiesBannerHeight === 0 ? 0 : cookiesBannerHeight
      }
}
By Kubus, 2018-02-28 11:00:11
this.props.HeaderStore.setHeader(true, null, false, false, true, true,'dashboardNavigation');
By Fluttershy, 2018-01-19 08:53:26
scrollToEl($el.parent().parent().parent());

Someones idea of how to select an element to scroll to.... Please no.

By Anonymous, 2019-09-27 15:20:17
let verificaAdmin_Role = (req, res, next) => {

    let usuario = req.usuario;

    if (usuario.role === 'ADMIN_ROLE') {
        next();
    } else {
        return res.status(409).json({
            ok: false,
            err: {
                message: 'El usuario no es administrador.'
            }
        })
    }

};

By rootweiller, 2020-06-18 18:30:41
socket.on('newMessage', (messageObj) => {
	if (roomNumber === messageObj.roomNumber) {

		console.log("message received:" + messageObj.message);
		$('#messages').append($('<li>').text(messageObj.userName + ' : ' + messageObj.message));

	}
});

socket.in wasn't behaving as advertised (broadcasting to all rooms). I decided to take matters into my own hands.

By Andrew, 2017-12-13 02:57:58
/**
 * Stringify a JSON object
 * @param {*} value JSON value to stringify
 * @returns {string} stringify JSON
 */
function stringify(value) {
    var result = {};
    try {
        result = JSON.stringify(value);
    } catch (e) {
        Logger.error('Error while trying to stringify ' + e);
        result = JSON.stringify(result);
    }
    return result;
}

Stringify a JSON object

By Ihor Did, 2023-04-12 19:36:08