<commit_before>// Javascript Notes

// strings
var name = "Joe";
name.length; // get length of string
name[0]; // get "first" element of string
name[name.length - 1]; // get last element of string

// numbers
var number = 4; // set number
var other = (4 * 2) + 4; // combining operations
Math.random(); // creates floating point num 0 (incl) to 1 (excl)

// arrays
var sampleArray = ["Joe", 42]; // holds different data
var nested = [["Bob", 32]]; // make nested array
sampleArray[0]; // access first element, zero-indexed
sampleArray.pop(); // remove and return last element
sampleArray.push(42); // "push" data to last element
sampleArray.shift(); // remove first element
sampleArray.unshift("Joe"); // add data to first element

// functions
function ourFunction(a, b) {
    // do stuff here
    return a - b;
};<commit_msg>add javascript note on objects<commit_after>// Javascript Notes

// strings
var name = "Joe";
name.length; // get length of string
name[0]; // get "first" element of string
name[name.length - 1]; // get last element of string

// numbers
var number = 4; // set number
var other = (4 * 2) + 4; // combining operations
Math.random(); // creates floating point num 0 (incl) to 1 (excl)

// arrays
var sampleArray = ["Joe", 42]; // holds different data
var nested = [["Bob", 32]]; // make nested array
sampleArray[0]; // access first element, zero-indexed
sampleArray.pop(); // remove and return last element
sampleArray.push(42); // "push" data to last element
sampleArray.shift(); // remove first element
sampleArray.unshift("Joe"); // add data to first element

// functions
function ourFunction(a, b) {
    // do stuff here
    return a - b;
};

// javascript object
var car = {
  "wheels":4,
  "engines":1,
  "seats":5
};
{'fraction_non_alphanumeric': 0.14922813036020582, 'fraction_numerical': 0.018867924528301886, 'mean_word_length': 3.3640897755610975, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2585828', 'n_tokens_mistral': 554, 'n_tokens_neox': 515, 'n_words': 211}