@anonymous/

RowdyPureCougar

JavaScript

No description

fork
loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.46460477904706754","path":"main.js","file":{"path":"main.js","content":{"asEncoding":{"base64":"LyoKSW4gdGhpcyBwcm9ncmFtbWluZyBleGVyY2lzZSwgeW91J3JlIGdvaW5nIHRvIGxlYXJuIGFib3V0IGZ1bmN0aW9ucywgYm9vbGVhbiAodHJ1ZS9mYWxzZSkgdmFsdWVzLCBzdHJpbmdzLCBhbmQgdGhlIGlmLXN0YXRlbWVudC4KCkEgZnVuY3Rpb24gaXMgYSBibG9jayBvZiBjb2RlIHRoYXQgdGFrZXMgYW4gaW5wdXQgYW5kIHByb2R1Y2VzIGFuIG91dHB1dC4gSW4gdGhpcyBleGFtcGxlLCBib29sZWFuX3RvX3N0cmluZyBpcyBhIGZ1bmN0aW9uIHdob3NlIGlucHV0IGlzIGVpdGhlciB0cnVlIG9yIGZhbHNlLCBhbmQgd2hvc2Ugb3V0cHV0IGlzIHRoZSBzdHJpbmcgcmVwcmVzZW50YXRpb24gb2YgdGhlIGlucHV0LCBlaXRoZXIgInRydWUiIG9yICJmYWxzZSIuCgpBIGNvbW1vbiBpZGVhIHdlIG9mdGVuIHdhbnQgdG8gcmVwcmVzZW50IGluIGNvZGUgaXMgdGhlIGNvbmNlcHQgb2YgdHJ1ZSBhbmQgZmFsc2UuIEEgdmFyaWFibGUgdGhhdCBjYW4gZWl0aGVyIGJlIHRydWUgb3IgZmFsc2UgaXMgY2FsbGVkIGEgYm9vbGVhbiB2YXJpYWJsZS4gSW4gdGhpcyBleGFtcGxlLCB0aGUgaW5wdXQgdG8gYm9vbGVhbl90b19zdHJpbmcgKHJlcHJlc2VudGVkIGJ5IHRoZSB2YXJpYWJsZSBiKSBpcyBhIGJvb2xlYW4uCgpMYXN0bHksIHdoZW4gd2Ugd2FudCB0byB0YWtlIG9uZSBhY3Rpb24gaWYgYSBib29sZWFuIGlzIHRydWUsIGFuZCBhbm90aGVyIGlmIGl0IGlzIGZhbHNlLCB3ZSB1c2UgYW4gaWYtc3RhdGVtZW50LgoKRm9yIHRoaXMga2F0YSwgZG9uJ3Qgd29ycnkgYWJvdXQgZWRnZSBjYXNlcyBsaWtlIHdoZXJlIHVuZXhwZWN0ZWQgaW5wdXQgaXMgcGFzc2VkIHRvIHRoZSBmdW5jdGlvbi4gWW91J2xsIGdldCB0byB3b3JyeSBhYm91dCB0aGVzZSBlbm91Z2ggaW4gbGF0ZXIgZXhlcmNpc2VzLgoKKi8KCmZ1bmN0aW9uIGJvb2xlYW5Ub1N0cmluZyhiKXsKICAvL3lvdXIgY29kZSBoZXJlCn0KCgovKgpUZXN0LmFzc2VydEVxdWFscyhib29sZWFuVG9TdHJpbmcodHJ1ZSksICJ0cnVlIiwgJ1doZW4gd2UgcGFzcyBpbiB0cnVlLCB3ZSB3YW50IHRoZSBzdHJpbmcgInRydWUiIGFzIG91dHB1dCcpOwpUZXN0LmFzc2VydEVxdWFscyhib29sZWFuVG9TdHJpbmcoZmFsc2UpLCAiZmFsc2UiLCAnV2hlbiB3ZSBwYXNzIGluIGZhbHNlLCB3ZSB3YW50IHRoZSBzdHJpbmcgImZhbHNlIiBhcyBvdXRwdXQnKTsKKi8="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
In this programming exercise, you're going to learn about functions, boolean (true/false) values, strings, and the if-statement.

A function is a block of code that takes an input and produces an output. In this example, boolean_to_string is a function whose input is either true or false, and whose output is the string representation of the input, either "true" or "false".

A common idea we often want to represent in code is the concept of true and false. A variable that can either be true or false is called a boolean variable. In this example, the input to boolean_to_string (represented by the variable b) is a boolean.

Lastly, when we want to take one action if a boolean is true, and another if it is false, we use an if-statement.

For this kata, don't worry about edge cases like where unexpected input is passed to the function. You'll get to worry about these enough in later exercises.

*/

function booleanToString(b){
  //your code here
}


/*
Test.assertEquals(booleanToString(true), "true", 'When we pass in true, we want the string "true" as output');
Test.assertEquals(booleanToString(false), "false", 'When we pass in false, we want the string "false" as output');
*/
Native Browser JavaScript