From 381a06839a718b737de36894287ccb0d69ff2dbd Mon Sep 17 00:00:00 2001 From: yourealt <84110576+yourealt@users.noreply.github.com> Date: Mon, 13 Sep 2021 08:28:27 -0400 Subject: [PATCH] added more javascript quotes (#1843) by yourealt --- static/quotes/code_javascript.json | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/static/quotes/code_javascript.json b/static/quotes/code_javascript.json index a5e7fdf0f..0a39cc5d5 100644 --- a/static/quotes/code_javascript.json +++ b/static/quotes/code_javascript.json @@ -48,6 +48,24 @@ "source": "GitHub - CodingTrain/ColorClassifer-TensorFlow.js", "length": 236, "id": 7 + }, + { + "text": "$('button').click(function(){\\n\\t$.post('demo_test_post.asp',\\n{\\n\\t\\tname: 'Donald Duck',\\n\\t\\tcity: 'Duckburg'\\n\\t},\n\\tfunction(data, status){\\n\\t\\talert('Data: ' + data + '\nStatus: ' + status);\\n\\t});\\n});", + "source": "W3Schools - jQuery Get/Post", + "length": 228, + "id": 8 + }, + { + "text": "const points = [40, 100, 1, 5, 25, 10];\\n\\nfor (let i = points.length -1; i > 0; i--) {\\n\\tlet j = Math.floor(Math.random() * i)\\n\\tlet k = points[i]\\n\\tpoints[i] = points[j]\\n\\tpoints[j] = k\\n}", + "source": "W3Schools JS Array Sort - Fisher Bates Method", + "length": 205, + "id": 9 + }, + { + "text": "function quicksort(arr){\\n\\tvar pivot = arr[0];\\n\\n\\tvar left = [];\\n\\tvar right = [];\\n\\n\\tfor (var i = 1; i < arr.length; i++) {\\n\\t\\tarr[i] < pivot ? left.push(arr[i]) : right.push(arr[i]);\\n\\t}\\n\\n\\treturn quicksort(left).concat(pivot, quicksort(right));\\n}", + "source": "JavaScript Quicksort Algorithm", + "length": 280, + "id": 10 } ] -} +} \ No newline at end of file